RateAPI API Key Management API

Issuing, inspecting, and revoking API keys, and reading quota usage.

GitHub OpenAPI

Operations 3

POST /keys Create a new API key #
GET /keys/{keyId}/usage Get usage statistics for an API key #
DELETE /keys/{keyId} Disable an API key #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/rateapi-dev:rateapi-dev-api-key-management-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

rateapi-dev-api-key-management-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Rate API Key Management API
  description: 'API for intelligent financial rate decisions and relationship-aware credit union discovery across the United States. **Primary Endpoint**: Use `/v1/decisions` to get product-matched recommendations based on borrower context and current market rates. **Institution Discovery**: Use `/credit-unions/nearby?zip=...` to find the nearest NCUA-reported branch per credit union, then `/credit-unions/{state}/{slug}` for current rates, membership eligibility, services, branches, and source-labelled NCUA quarterly facts. **Interactive Documentation**: Visit api.rateapi.dev in your browser to access the full Swagger UI interface where you can test API endpoints directly. **Authentication**: Most endpoints require an API key passed via the `X-API-Key` header. Create a free API key using `POST /keys`. **Tiered Rate Limits**:

    - **Tier 1 (Free)**: 20 requests per 30 days

    - **Tier 2 (Pro)**: 100 requests per 30 days ($49/month)

    - **Tier 3 (Enterprise)**: Unlimited requests with uncapped querying and SFTP/CSV/Excel exports


    Contact us to upgrade your tier for higher limits. **Caching**: Responses are aggressively cached at the edge for optimal performance. Cache status is indicated via `X-Cache` response headers. **Key Features**:

    - **Smart Decisions** (`/v1/decisions`): Get personalized financing recommendations with confidence scores

    - **Nearest Credit Unions** (`/credit-unions/nearby`): Discover local institutions by approximate branch distance

    - **Relationship-Aware Profiles** (`/credit-unions/{state}/{slug}`): Inspect rates, membership, NCUA facts, services, and branches

    - **API Key Management** (`/keys`): Self-service key creation and usage tracking

    - Evidence-backed loan and deposit rate data from credit unions nationwide

    - Edge-cached for fast global access

    - RESTful JSON API with comprehensive OpenAPI documentation


    ## Versioning and deprecation


    Product and decision endpoints use the `/v1` URL prefix. Stable reference routes such as `/credit-unions`, `/credit-unions/nearby`, `/credit-unions/{state}/{slug}`, `/meta`, and `/keys` are intentionally unversioned; use each path exactly as published in this document rather than adding `/v1`. Additive changes — new endpoints, new response fields, new optional parameters, new enum members — ship continuously, so write clients that ignore fields they do not recognise rather than treating them as errors. Nothing is removed without at least **180 days** of notice. A deprecated surface keeps behaving exactly as before and starts sending RFC 8594 `Deprecation` and `Sunset` headers, plus a `Link: ; rel="deprecation"`, and is marked `deprecated: true` in this document so a generated client can flag it at build time. Nothing is currently deprecated. Full policy: https://rateapi.dev/deprecation-policy


    ## Rate limits


    Every response carries `RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset` (seconds) and `RateLimit-Policy`, alongside the legacy `X-RateLimit-*` headers, which are retained indefinitely. A 429 additionally carries `Retry-After` in seconds. Read them and self-throttle rather than discovering the ceiling by hitting it. ## Long-running work


    Every operation in this API completes inside its own request — there is no batch job, no report render, and no crawl to wait on, so nothing returns `202 Accepted` today. The convention is fixed in advance so the first operation that needs it does not invent its own: a long-running route answers `202` with a `Location` header naming a status resource and a body matching `AsyncJobAccepted` (`job_id`, `status`, `status_url`), and the client polls no faster than `Retry-After`. See the `Accepted` response and `AsyncJobAccepted` schema in components. ## Authenticating


    A `401` carries `WWW-Authenticate: Bearer resource_metadata="https://api.rateapi.dev/.well-known/oauth-protected-resource"`.'
  version: 2.0.0
  contact:
    name: Rate API
    url: https://rateapi.dev
  termsOfService: https://rateapi.dev/terms
  x-deprecation-policy: https://rateapi.dev/deprecation-policy
  license:
    name: RateAPI Terms of Service
    url: https://rateapi.dev/terms
servers:
- url: https://api.rateapi.dev
  description: Production
security: []
tags:
- name: API Key Management
  description: Issuing, inspecting, and revoking API keys, and reading quota usage.
paths:
  /keys:
    post:
      operationId: createApiKey
      summary: Create a new API key
      description: 'Creates a new API key for accessing the API. RateAPI—not the client—generates the credential. Supply a fresh, cryptographically random UUIDv4 in the optional `Idempotency-Key` header so a byte-identical retry can replay the same encrypted response for up to 24 hours without minting a second key. Callers that omit the header retain the legacy one-time response behavior and cannot recover a lost response. Store the returned credential securely; after the recovery window it cannot be retrieved.


        New keys are created at **Tier 1 (Free)** with 20 requests per 30 days. **An email address is required** in the request body. Link your key to an organization for plan-level shared limits.


        **Rate limit**: 1 key per IP address per 30 days to prevent abuse.'
      parameters:
      - $ref: '#/components/parameters/KeyEnrollmentIdempotencyKey'
      requestBody:
        description: Required. Email address for the account and API update notifications.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKeyRequest'
            example:
              email: developer@example.com
      responses:
        '201':
          description: API key created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateKeyResponse'
              examples:
                withEmail:
                  summary: With email
                  value:
                    id: 9f4c1ad27b83e650
                    key: rk_a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1
                    message: Store this key securely. An identical retry can recover it for up to 24 hours; after that it cannot be retrieved.
                    tier:
                      level: 1
                      name: Free
                      limit: 20
                      windowDays: 30
                    emailRegistered: true
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-RateLimit-Scope:
              $ref: '#/components/headers/X-RateLimit-Scope'
            Idempotent-Replayed:
              $ref: '#/components/headers/Idempotent-Replayed'
        '400':
          description: Invalid Idempotency-Key UUIDv4, invalid or missing email, or malformed JSON.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          $ref: '#/components/responses/IdempotencyConflict'
        '429':
          description: Rate limit exceeded for key creation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyCreationRateLimitError'
              example:
                error: Rate limit exceeded
                message: You can create up to 1 API key per 30 days
                remaining: 0
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-RateLimit-Scope:
              $ref: '#/components/headers/X-RateLimit-Scope'
            Retry-After:
              $ref: '#/components/headers/Retry-After'
        '503':
          description: Recoverable key enrollment is temporarily unavailable. No key was created for a first attempt; a failed replay never mints a replacement.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - API Key Management
      security: []
  /keys/{keyId}/usage:
    get:
      operationId: getKeyUsage
      summary: Get usage statistics for an API key
      description: 'Returns usage statistics including requests made, remaining quota, tier information, and recent request history. You can only view usage for your own API key.


        **Authentication required**: Pass your API key in the `X-API-Key` header.'
      security:
      - apiKey: []
      parameters:
      - name: keyId
        in: path
        required: true
        description: The ID of the API key (returned when the key was created)
        schema:
          type: string
          example: a1b2c3d4e5f6g7h8
      responses:
        '200':
          description: Usage statistics retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageResponse'
              examples:
                freeKeyPartway:
                  summary: Free key partway through its window
                  value:
                    keyId: 9f4c1ad27b83e650
                    tier:
                      level: 1
                      name: Free
                    usage:
                      used: 5
                      remaining: 15
                      limit: 20
                      windowDays: 30
                      resetAt: '2026-09-15T12:00:00.000Z'
                      scope: key
                    recentRequests:
                    - endpoint: /v1/decisions
                      timestamp: '2026-08-20T10:30:00.000Z'
                    - endpoint: /v1/rates
                      timestamp: '2026-08-20T10:29:14.000Z'
                newKey:
                  summary: Newly issued key, nothing spent yet
                  value:
                    keyId: 9f4c1ad27b83e650
                    tier:
                      level: 1
                      name: Free
                    usage:
                      used: 0
                      remaining: 20
                      limit: 20
                      windowDays: 30
                      resetAt: '2026-09-20T12:00:00.000Z'
                      scope: key
                    recentRequests: []
                tierOne:
                  summary: Tier 1 (Free) usage
                  value:
                    keyId: 9f4c1ad27b83e650
                    tier:
                      level: 1
                      name: Free
                    usage:
                      used: 5
                      remaining: 15
                      limit: 20
                      windowDays: 30
                      resetAt: '2024-02-15T12:00:00.000Z'
                      scope: key
                    recentRequests:
                    - endpoint: /v1/decisions
                      timestamp: '2024-01-16T10:30:00.000Z'
                enterpriseOrg:
                  summary: Enterprise organization — no quota
                  value:
                    keyId: 9f4c1ad27b83e650
                    tier:
                      level: 3
                      name: Enterprise
                    usage:
                      remaining: unlimited
                      limit: unlimited
                      windowDays: 30
                      scope: organization
                    organizationId: org_7c2f9b41
                    recentRequests:
                    - endpoint: /v1/decisions
                      timestamp: '2026-08-20T10:30:00.000Z'
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-RateLimit-Scope:
              $ref: '#/components/headers/X-RateLimit-Scope'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Not authorized to view this key's usage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Not authorized to view this key's usage
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageRateLimitError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - API Key Management
  /keys/{keyId}:
    delete:
      operationId: deleteApiKey
      summary: Disable an API key
      description: 'Permanently disables an API key. This action cannot be undone. You can only disable your own API key.


        **Authentication required**: Pass your API key in the `X-API-Key` header.'
      security:
      - apiKey: []
      parameters:
      - name: keyId
        in: path
        required: true
        description: The ID of the API key to disable
        schema:
          type: string
          example: a1b2c3d4e5f6g7h8
      responses:
        '200':
          description: API key disabled successfully
          content:
            application/json:
              schema:
                type: object
                required:
                - message
                properties:
                  message:
                    type: string
                    description: Human-readable detail about this result.
                    example: API key disabled successfully
              example:
                message: API key disabled successfully
          headers:
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
            RateLimit-Policy:
              $ref: '#/components/headers/RateLimit-Policy'
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
            X-RateLimit-Scope:
              $ref: '#/components/headers/X-RateLimit-Scope'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Not authorized to delete this key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Not authorized to delete this key
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageRateLimitError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      tags:
      - API Key Management
components:
  headers:
    RateLimit-Reset:
      description: Seconds until the window resets (RFC 9331). Note this is a DELTA in seconds, whereas the legacy X-RateLimit-Reset carries an ISO 8601 instant.
      schema:
        type: integer
        example: 2591940
    X-RateLimit-Reset:
      description: ISO 8601 instant at which the window resets. The unprefixed RateLimit-Reset carries the same fact as a seconds delta.
      schema:
        type: string
        format: date-time
    Idempotent-Replayed:
      description: Present with value `true` when this response safely replays a previously committed enrollment instead of creating another key.
      schema:
        type: string
        enum:
        - 'true'
        example: 'true'
    X-RateLimit-Scope:
      description: Whether the quota applied is the key’s own or the organization’s.
      schema:
        type: string
        enum:
        - key
        - organization
        - anonymous
    RateLimit-Limit:
      description: Requests allowed in the current window (RFC 9331). Absent on unmetered enterprise keys, which have no quota to express.
      schema:
        type: integer
        example: 20
    RateLimit-Policy:
      description: The quota and its window, e.g. `20;w=2592000` for 20 requests per 30 days.
      schema:
        type: string
        example: 20;w=2592000
    X-RateLimit-Limit:
      description: Legacy spelling of RateLimit-Limit. Sends the string `unlimited` on unmetered keys. Retained indefinitely; prefer the unprefixed header in new code.
      schema:
        type: string
        example: '20'
    X-RateLimit-Remaining:
      description: Legacy spelling of RateLimit-Remaining. Sends the string `unlimited` on unmetered keys.
      schema:
        type: string
        example: '19'
    RateLimit-Remaining:
      description: Requests left in the current window (RFC 9331). Already accounts for the request that produced this response.
      schema:
        type: integer
        example: 19
    Retry-After:
      description: Seconds to wait before retrying. Sent on 429 responses only.
      schema:
        type: integer
        example: 2591940
  parameters:
    KeyEnrollmentIdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: 'Optional but strongly recommended: a fresh, cryptographically random UUIDv4 identifying this enrollment request. It cannot authorize normal RateAPI calls, but for 24 hours it is a sensitive recovery capability that can replay the returned API key when paired with the identical request body. Never log or share it. Persist it only until the returned credential is safely stored, and reuse it only with the byte-identical request body after an ambiguous timeout. Omitting the header preserves the legacy one-time response behavior but makes a lost response unrecoverable.'
      schema:
        type: string
        format: uuid
        pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89aAbB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$
  schemas:
    UsageResponse:
      type: object
      required:
      - keyId
      - tier
      - usage
      - recentRequests
      properties:
        keyId:
          type: string
          description: The API key ID
          example: 9f4c1ad27b83e650
        tier:
          type: object
          required:
          - level
          - name
          properties:
            level:
              type: integer
              description: 'Tier level: 1 = Free, 2 = Pro, 3 = Enterprise.'
              enum:
              - 1
              - 2
              - 3
              example: 1
            name:
              type: string
              description: Human-readable tier name
              enum:
              - Free
              - Pro
              - Enterprise
              example: Free
          description: Current tier information for this key
        usage:
          allOf:
          - $ref: '#/components/schemas/UsageInfo'
          description: Usage statistics for the current rate limit window
        recentRequests:
          type: array
          items:
            type: object
            required:
            - endpoint
            - timestamp
            properties:
              endpoint:
                type: string
                description: API endpoint that was called
                example: /v1/decisions
              timestamp:
                type: string
                format: date-time
                description: ISO 8601 timestamp when the request was made
                example: '2024-01-16T10:30:00.000Z'
          description: Last 10 requests made with this key, ordered by most recent first
        organizationId:
          type: string
          description: Organization the key belongs to. Present only for a key connected to an organization; the quota is then pooled across that organization.
      description: Current quota state for the calling API key, plus its most recent requests.
    CreateKeyResponse:
      type: object
      required:
      - id
      - key
      - message
      - tier
      - emailRegistered
      properties:
        id:
          type: string
          description: Unique identifier for the API key. Use this ID for /keys/:id endpoints to check usage or disable the key.
          example: 9f4c1ad27b83e650
        key:
          type: string
          pattern: ^rk_[a-f0-9]{64}$
          description: Server-generated API key to use in X-API-Key. A byte-identical retry with the same enrollment UUID can replay it for up to 24 hours; after that only the long-term hash remains.
          example: rk_a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1a3f1
        message:
          type: string
          description: Warning message reminding you to store the key securely
          example: Store this key securely. An identical retry can recover it for up to 24 hours; after that it cannot be retrieved.
        tier:
          allOf:
          - $ref: '#/components/schemas/TierInfo'
          description: Tier information including level, name, limit, and window
        emailRegistered:
          type: boolean
          description: Present and true when an email was provided and validated.
          example: true
      description: A newly issued API-key registration. RateAPI generates `key`; its hash is stored long-term. When an enrollment UUID is supplied, the encrypted response is replayable for 24 hours and then queued for the next hourly deletion pass.
    CreateKeyRequest:
      type: object
      description: Required enrollment identity and optional bounded signup attribution.
      required:
      - email
      properties:
        email:
          type: string
          format: email
          maxLength: 254
          description: Required email address for account recovery and important API updates. Does not affect rate limits.
          example: developer@example.com
        source:
          type: string
          maxLength: 200
          description: Optional bounded signup-surface attribution, such as `npm-cli`.
          example: npm-cli
        referrer:
          type: string
          maxLength: 300
          description: Optional bounded signup referrer attribution. Never used for authorization.
          example: https://rateapi.dev/agents
    TierInfo:
      type: object
      required:
      - level
      - name
      properties:
        level:
          type: integer
          description: Tier level (1=Free, 2=Pro, 3=Enterprise)
          enum:
          - 1
          - 2
          - 3
          example: 1
        name:
          type: string
          description: Human-readable tier name
          enum:
          - Free
          - Pro
          - Enterprise
          example: Free
        limit:
          type: integer
          description: Maximum requests allowed per window for this tier. Only present in CreateKeyResponse.
          minimum: 0
          example: 100
        windowDays:
          type: integer
          description: Rate limit window in days. Only present in CreateKeyResponse.
          example: 30
      description: The plan an API key is on, and the request quota that plan carries.
    UsageRateLimitError:
      type: object
      required:
      - error
      - message
      - tier
      - resetAt
      properties:
        error:
          type: string
          description: Short machine-comparable error label.
          example: Rate limit exceeded
        message:
          type: string
          description: Human-readable message explaining how many requests were exceeded
          example: You have used all 20 requests for this 30-day period
        tier:
          type: object
          required:
          - level
          - name
          - limit
          properties:
            level:
              type: integer
              description: Current tier level
              example: 1
            name:
              type: string
              description: Current tier name
              example: Free
            limit:
              type: integer
              description: Request limit for this tier
              example: 100
          description: Information about the current tier and its limits
        resetAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the rate limit resets and usage counter restarts
          example: '2024-02-15T12:00:00.000Z'
        upgradeInfo:
          type: string
          description: Information about upgrading to a higher tier
          example: Contact us to upgrade your tier for higher limits
        traceId:
          type: string
          description: Unique trace ID for this request, useful for debugging and support requests
          example: a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6
      description: Returned when the calling key has exhausted its tier quota, including when the window resets and how to raise the limit.
    KeyCreationRateLimitError:
      type: object
      required:
      - error
      - message
      - remaining
      properties:
        error:
          type: string
          description: Short machine-comparable error label.
          example: Rate limit exceeded
        message:
          type: string
          description: Human-readable message explaining the rate limit
          example: You can create up to 1 API key per 30 days
        remaining:
          type: integer
          description: Number of key creations remaining in the current window (0 when rate limited)
          minimum: 0
          example: 0
      description: Returned when key creation is rate limited. Anonymous registration is capped at one key per originating IP per 30 days.
    UsageInfo:
      type: object
      required:
      - windowDays
      properties:
        used:
          type: integer
          description: Requests used in the current window. Absent for an Enterprise organization, which has no quota to count against.
          minimum: 0
          example: 25
        remaining:
          oneOf:
          - type: integer
            minimum: 0
            description: Requests remaining in current window
          - type: string
            enum:
            - unlimited
            description: Returned as the literal string `unlimited` for an Enterprise organization, whose plan carries no request quota.
          example: 75
          description: Requests still available in the current window.
        limit:
          oneOf:
          - type: integer
            minimum: 0
            description: Maximum requests allowed per window
          - type: string
            enum:
            - unlimited
            description: Returned as the literal string `unlimited` for an Enterprise organization, whose plan carries no request quota.
          example: 100
          description: Total requests the key’s tier allows per window.
        windowDays:
          type: integer
          description: Rate limit window in days (always 30)
          example: 30
        resetAt:
          type: string
          format: date-time
          description: ISO 8601 timestamp when the rate limit window resets. Absent for an Enterprise organization, which has no window.
          example: '2024-02-15T12:00:00.000Z'
        scope:
          type: string
          description: Whether the quota is counted per key or pooled across the organization the key belongs to.
          enum:
          - key
          - organization
          example: key
      description: Requests consumed and remaining against the key’s quota for the current window.
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
          description: Error message describing what went wrong
          example: API key required. Get one at POST /keys
        message:
          type: string
          description: Additional error details or context (optional)
        code:
          type: string
          description: Stable machine-readable reason code when the endpoint can identify one, for example `invalid_product_category`.
        field:
          type: string
          description: Request field that failed validation, when applicable.
        received:
          description: The rejected value, when it is safe and useful to echo.
        allowed_values:
          type: array
          items:
            type: string
          description: Canonical values accepted for an enum field.
        did_you_mean:
          description: A canonical replacement value or one or more corrected method/path suggestions.
        example:
          type: object
          additionalProperties: true
          description: A corrected request fragment that can be copied into the next attempt.
        docs:
          type: string
          format: uri
          description: Documentation for correcting the request.
        traceId:
          type: string
          description: Unique trace ID for this request, useful for debugging and support requests (optional, included in most error responses)
          example: a1b2c3d4-e5f6-g7h8-i9j0-k1l2m3n4o5p6
      description: 'Standard error envelope returned by every failing endpoint: a short `error`, an optional human-readable `message`, and the `traceId` to quote in a support request. Validation and routing errors may also include a stable `code`, the rejected `field` and `received` value, canonical `allowed_values`, `did_you_mean`, and a `docs` URL so clients can recover without guessing.'
  responses:
    IdempotencyConflict:
      description: Idempotency-Key was reused with a different request body.
      headers: {}
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: Idempotency-Key reused with a different request body
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: API key for authentication. Create a key using POST /keys. Keys start with 'rk_' prefix.
externalDocs:
  description: RateAPI developer portal — keys, quickstart, MCP server, sandbox
  url: https://rateapi.dev/developers