ScaledThought Keys API

The Keys API from ScaledThought — 4 operation(s) for keys.

GitHub OpenAPI

Operations 6

GET /v1/keys List keys #
POST /v1/keys Create key #
DELETE /v1/keys/self Revoke self #
POST /v1/keys/{id}/rotate Rotate key #
PATCH /v1/keys/{id} Update key #
DELETE /v1/keys/{id} Revoke 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/scaledthought-com:scaledthought-com-keys-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

scaledthought-com-keys-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: ScaledThought control plane Keys API
  version: 0.1.0
  description: Accounts, keys, budgets, usage, prepaid credits (human-approved top-ups), files, batches and models. Inference is OpenAI-compatible at the base_url returned by signup.
servers:
- url: https://api.us.scaledthought.com
  description: us region
tags:
- name: Keys
paths:
  /v1/keys:
    get:
      operationId: listKeys
      security:
      - apiKey: []
      responses:
        '200':
          description: Keys (prefixes only), each with lives_in (where it is stored, or null)
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, revoked or expired (code key_expired) API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '421':
          description: Key belongs to another region
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Keys
      summary: List keys
      x-summary-source: derived
    post:
      operationId: createKey
      description: Creates a key (returned once). lives_in (optional, max 300 printable chars) records where it will be stored, e.g. vercel:billing-service/production; display only.
      security:
      - apiKey: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateKeyInput'
      responses:
        '201':
          description: The new key, shown once
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, revoked or expired (code key_expired) API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '421':
          description: Key belongs to another region
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Keys
      summary: Create key
      x-summary-source: derived
  /v1/keys/self:
    delete:
      operationId: revokeSelf
      description: 'Revokes the key making the request (and its sub-agent keys). Needs no scope: any key can give itself up, e.g. if it may have leaked. Audited.'
      security:
      - apiKey: []
      responses:
        '200':
          description: The calling key, now revoked
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, revoked or expired (code key_expired) API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '421':
          description: Key belongs to another region
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Keys
      summary: Revoke self
      x-summary-source: derived
  /v1/keys/{id}/rotate:
    post:
      operationId: rotateKey
      description: Mints a replacement key with the same name, scopes, daily budget, rate limits, parent and lives_in (returned once), moves the old key's sub-agent keys under it, and makes the old key expire after grace (0 to 7 days, default 24h). Audited.
      security:
      - apiKey: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RotateKeyInput'
      responses:
        '201':
          description: The new key, shown once, with rotated_from
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, revoked or expired (code key_expired) API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '421':
          description: Key belongs to another region
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Keys
      summary: Rotate key
      x-summary-source: derived
  /v1/keys/{id}:
    patch:
      operationId: updateKey
      description: Changes a key's name, daily budget, rate limits or lives_in (null clears it).
      security:
      - apiKey: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateKeyInput'
      responses:
        '200':
          description: Updated key
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, revoked or expired (code key_expired) API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '421':
          description: Key belongs to another region
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Keys
      summary: Update key
      x-summary-source: derived
    delete:
      operationId: revokeKey
      security:
      - apiKey: []
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Revoked
          content:
            application/json:
              schema:
                type: object
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, invalid, revoked or expired (code key_expired) API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '421':
          description: Key belongs to another region
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      tags:
      - Keys
      summary: Revoke key
      x-summary-source: derived
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type:
              - string
              - 'null'
          required:
          - message
          - type
          - code
      required:
      - error
    UpdateKeyInput:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
        daily_budget_usd:
          anyOf:
          - type: number
            exclusiveMinimum: 0
            maximum: 1000000
          - type: 'null'
        rpm_limit:
          anyOf:
          - type: integer
            exclusiveMinimum: 0
            maximum: 100000
          - type: 'null'
        tpm_limit:
          anyOf:
          - type: integer
            exclusiveMinimum: 0
            maximum: 100000000
          - type: 'null'
        lives_in:
          description: Where this key is stored (null clears it)
          anyOf:
          - type: string
            minLength: 1
            maxLength: 300
            pattern: ^[^\p{C}]+$
            description: Where this key is stored, e.g. "vercel:billing-service/production" (display only, max 300 chars)
          - type: 'null'
    CreateKeyInput:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        name:
          type: string
          minLength: 1
          maxLength: 80
        env:
          default: live
          type: string
          enum:
          - live
          - test
        scopes:
          default:
          - inference
          - read
          description: A subset of the calling key's own scopes
          minItems: 1
          type: array
          items:
            type: string
            enum:
            - inference
            - read
            - keys
            - billing
        daily_budget_usd:
          description: Hard daily spend cap for this key
          type: number
          exclusiveMinimum: 0
          maximum: 1000000
        rpm_limit:
          type: integer
          exclusiveMinimum: 0
          maximum: 100000
        tpm_limit:
          type: integer
          exclusiveMinimum: 0
          maximum: 100000000
        expires_in:
          description: Key lifetime, e.g. "30d" or "12h" (max 365d)
          type: string
          pattern: ^(0|[1-9]\d{0,5}[smhd])$
        expires_at:
          description: When the key stops working (ISO 8601, at most 365 days ahead). Use this or expires_in
          type: string
          format: date-time
          pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
        child:
          default: false
          description: 'Create a sub-agent key: it records the calling key as its parent and is revoked when the parent is. Keys created by a child key are always children'
          type: boolean
        lives_in:
          type: string
          minLength: 1
          maxLength: 300
          pattern: ^[^\p{C}]+$
          description: Where this key is stored, e.g. "vercel:billing-service/production" (display only, max 300 chars)
      required:
      - name
    RotateKeyInput:
      $schema: https://json-schema.org/draft/2020-12/schema
      type: object
      properties:
        grace:
          default: 24h
          description: How long the old key keeps working, "0" to "7d" (default "24h")
          type: string
          pattern: ^(0|[1-9]\d{0,5}[smhd])$
        expires_in:
          description: 'Lifetime of the new key (default: the old key''s lifetime, if it had one; else none)'
          type: string
          pattern: ^(0|[1-9]\d{0,5}[smhd])$
      additionalProperties: false
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: st_{region}_{env}_… key
    anthropicApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: st_{region}_{env}_… key