Skip to main content
POST
/
v1
/
me
/
api-keys
curl -X POST "https://api.chatgrid.ai/v1/me/api-keys" \
  -H "Authorization: Bearer cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
  -H "Content-Type: application/json" \
  -d '{"name": "CI/CD Pipeline", "scopes": ["read", "write"]}'
{
  "object": "api_key",
  "data": {
    "raw_key": "cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
    "id": "ee112233-4455-6677-8899-aabbccddeeff",
    "key_prefix": "cgk_live_a1b2",
    "name": "CI/CD Pipeline",
    "scopes": ["read", "write"],
    "created_at": "2026-03-15T14:00:00.000Z"
  }
}
Requires the admin scope.
name
string
required
A human-readable label for this key. 1-64 characters.
scopes
string[]
default:["read","write"]
Scopes to assign. Valid values: read, write, admin. At least one scope is required.
The raw_key field is returned only in this response. Store it securely — it cannot be retrieved again. If you lose the key, revoke it and create a new one.
curl -X POST "https://api.chatgrid.ai/v1/me/api-keys" \
  -H "Authorization: Bearer cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6" \
  -H "Content-Type: application/json" \
  -d '{"name": "CI/CD Pipeline", "scopes": ["read", "write"]}'
{
  "object": "api_key",
  "data": {
    "raw_key": "cgk_live_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0",
    "id": "ee112233-4455-6677-8899-aabbccddeeff",
    "key_prefix": "cgk_live_a1b2",
    "name": "CI/CD Pipeline",
    "scopes": ["read", "write"],
    "created_at": "2026-03-15T14:00:00.000Z"
  }
}