API Keys
Manage runtime API keys for projects
Returns the API keys for a specific project. API keys are used to authenticate requests to the Spice.ai runtime.
OAuth 2.0 access token obtained from the Spice.ai authentication service
The ID of the project
The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own.
^[A-Za-z0-9._-]{1,255}$API keys for the project
Primary API key
Secondary API key (for key rotation)
Invalid project ID
Unauthorized
Insufficient scope or viewer role cannot regenerate API keys
Project not found
Internal server error
GET /v1/projects/{projectId}/api-keys HTTP/1.1
Host: api.spice.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"api_key": "text",
"api_key_2": "text"
}Regenerates an API key for the specified project. This invalidates the previous key. Use key_number to specify which key to regenerate (0 for both, 1 for primary, 2 for secondary).
OAuth 2.0 access token obtained from the Spice.ai authentication service
The ID of the project
The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own.
^[A-Za-z0-9._-]{1,255}$Which API key to regenerate (0 = both, 1 = primary, 2 = secondary)
1Possible values: API key regenerated successfully
Primary API key
Secondary API key
Which key was regenerated (0 = both, 1 = primary, 2 = secondary)
Invalid request body or project ID
Unauthorized
Insufficient scope
Project not found
Internal server error
POST /v1/projects/{projectId}/api-keys HTTP/1.1
Host: api.spice.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"key_number": 1
}{
"api_key": "text",
"api_key_2": "text",
"regenerated_key": 0
}Legacy alias of /v1/projects/{projectId}/api-keys — projects were previously called apps. Returns the API keys for a specific project. API keys are used to authenticate requests to the Spice.ai runtime.
OAuth 2.0 access token obtained from the Spice.ai authentication service
The ID of the project
The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own.
^[A-Za-z0-9._-]{1,255}$API keys for the project
Primary API key
Secondary API key (for key rotation)
Invalid project ID
Unauthorized
Insufficient scope or viewer role cannot regenerate API keys
Project not found
Internal server error
GET /v1/apps/{appId}/api-keys HTTP/1.1
Host: api.spice.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"api_key": "text",
"api_key_2": "text"
}Legacy alias of /v1/projects/{projectId}/api-keys — projects were previously called apps. Regenerates an API key for the specified project. This invalidates the previous key. Use key_number to specify which key to regenerate (0 for both, 1 for primary, 2 for secondary).
OAuth 2.0 access token obtained from the Spice.ai authentication service
The ID of the project
The organization to act on, by handle. Omit it to act on the organization the credential is bound to; sending it blank is a 400, not the same as omitting it. A user credential may name any organization its owner belongs to; a machine credential is pinned to its own.
^[A-Za-z0-9._-]{1,255}$Which API key to regenerate (0 = both, 1 = primary, 2 = secondary)
1Possible values: API key regenerated successfully
Primary API key
Secondary API key
Which key was regenerated (0 = both, 1 = primary, 2 = secondary)
Invalid request body or project ID
Unauthorized
Insufficient scope
Project not found
Internal server error
POST /v1/apps/{appId}/api-keys HTTP/1.1
Host: api.spice.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"key_number": 1
}{
"api_key": "text",
"api_key_2": "text",
"regenerated_key": 0
}Last updated
Was this helpful?