{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/audioscrape-com/json-schema/audioscrape-com-api-key-schema.json",
  "title": "ApiKey",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/audioscrape-com-openapi.json#/components/schemas/ApiKey",
  "type": "object",
  "required": [
    "id",
    "key_name",
    "key_prefix"
  ],
  "properties": {
    "created_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC 3339 UTC timestamp."
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "When the key stops authenticating (RFC 3339). `null` = never expires,\nwhich is the case for every key issued before 2026-07-31."
    },
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "key_name": {
      "type": "string",
      "description": "Human-readable label for the key (shown in the dashboard)."
    },
    "key_prefix": {
      "type": "string",
      "description": "Display-safe prefix of the key (first 12 characters + \"...\"). Always\npresent. Use this to identify the key in logs and UIs."
    },
    "key_value": {
      "type": [
        "string",
        "null"
      ],
      "description": "The full bearer token, format `sk_<base64(32 random bytes)>`.\n**Returned only in the response to `POST /api/keys`** — Audioscrape\nstores only a SHA-256 hash, so list / delete endpoints cannot\nrecover the raw value. Save it client-side immediately on creation."
    },
    "last_used": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC 3339 UTC timestamp of the most recent request that used this key.\n`null` if the key has never been used."
    },
    "last_used_ip": {
      "type": [
        "string",
        "null"
      ],
      "description": "Source IP of the request described by `last_used` (as seen by our\nedge). `null` if the key has never been used or the IP was\nunavailable. Use it to spot a leaked key being used from somewhere\nunexpected."
    },
    "workspace_id": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64",
      "description": "Workspace this key is scoped to. `null` means the key follows the\nuser's `current_workspace_id` at request time (legacy behavior)."
    }
  }
}