Skip to main content
POST
/
v1
/
me
/
api-keys
Create an API key
curl --request POST \
  --url https://api.chatgrid.ai/v1/v1/me/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Production key",
  "scopes": [
    "read",
    "write"
  ]
}
'
{
  "object": "api_key",
  "data": {
    "id": "ee112233-4455-6677-8899-aabbccddeeff",
    "key_prefix": "cgk_live_a1b2",
    "name": "Production key",
    "scopes": [
      "read",
      "write"
    ],
    "rate_limit": 120,
    "last_used_at": "2026-03-15T12:00:00.000Z",
    "created_at": "2026-03-10T09:00:00.000Z",
    "expires_at": null,
    "raw_key": "cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
  }
}

Authorizations

Authorization
string
header
required

Pass your API key (prefixed cgk_) or a Supabase JWT in the Authorization: Bearer <token> header.

Body

application/json
name
string
required

A human-readable label for this key.

Required string length: 1 - 64
Example:

"Production key"

scopes
enum<string>[]

Scopes to assign. Defaults to read + write.

Available options:
read,
write,
admin
Example:
["read", "write"]

Response

API key created. The raw_key is only returned once.

object
enum<string>
Available options:
api_key
data
object