1. Keys
UsageRail API
  • HTTP check
    • Check a request
      POST
  • Customers
    • Create a customer
      POST
    • Get a customer
      GET
    • Claim an email or external ID
      POST
    • Get a customer's usage
      GET
  • Keys
    • Create a key
      POST
    • Revoke a key
      DELETE
  • Billing
    • Change a customer's plan
      POST
    • Open Stripe Checkout
      POST
    • Adjust a prepaid balance
      POST
  • Portal
    • Create a portal sign-in link
      POST
  • Schemas
    • Error
    • CheckRequest
    • CheckResult
    • Consumer
    • Usage
  1. Keys

Create a key

POST
/v1/consumers/{id}/keys
Only the first response includes the full key. A replay with the same idempotency key returns the IDs without it.

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Path Params

Header Params

Body Params application/json

Examples

Responses

๐ŸŸข201
application/json
The new key.
Bodyapplication/json

๐ŸŸ 404Error
๐ŸŸ 409Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://api.usagerail.com/v1/consumers//keys' \
--header 'Idempotency-Key;' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "name": "string"
}'
Response Response Example
201 - ๆˆๅŠŸ็คบไพ‹
{
    "key_id": "PRjuGinc",
    "consumer_id": "cons_7Qm2xR9s",
    "name": "Production",
    "key": "acme_live_PRjuGincAHq68hICyifjdBmNASZ1Fw9mwPOgy8pt0EJiLE"
}
Modified atย 2026-11-21 14:07:45
Previous
Get a customer's usage
Next
Revoke a key
Built with