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"
}
}
Creates a new API key. The full key is returned only once.
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"
}
}
admin scope.
read, write, admin. At least one scope
is required.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"
}
}