cURL
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" } }
Creates a new API key. The full key is returned only once in the raw_key field — store it securely. Requires admin scope.
raw_key
admin
Pass your API key (prefixed cgk_) or a Supabase JWT in the Authorization: Bearer <token> header.
cgk_
Authorization: Bearer <token>
A human-readable label for this key.
1 - 64
"Production key"
Scopes to assign. Defaults to read + write.
read
write
["read", "write"]
API key created. The raw_key is only returned once.
api_key
Show child attributes