Update a temporary API key
https://api.respan.ai/api/temporary-keys/{id}/Update an API key’s name, expiry, usage, rate, or spending limit. With an API key you can change name and expiry_date. Changing max_usage, rate_limit, spending_limit or limit_policies needs the dashboard, or a key explicitly granted the limit_policies permission.
Servers
https://api.respan.ai: Respan API Server
Authentication
RespanApiKey
Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.
HTTP scheme: bearer; format: Respan API key.
Authorization: Bearer $RESPAN_API_KEYPath parameters
id string RequiredRequest body
The request body is optional.
application/json
$ object Optional body
name string Optionalexpiry_date string OptionalFormat:
date-timemax_usage integer Optionalrate_limit number or null Optionalspending_limit number or null OptionalOpenAPI request schema
{
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Key name."
},
"expiry_date": {
"type": "string",
"format": "date-time",
"description": "Expiry date (ISO 8601)."
},
"max_usage": {
"type": "integer",
"description": "Maximum use count. -1 means unlimited."
},
"rate_limit": {
"type": "number",
"nullable": true
},
"spending_limit": {
"type": "number",
"nullable": true
}
}
}Responses
200
Updated API key.
application/json
$ object Body
id string Optionalname string Optionalprefix string Optionalis_test boolean Optionalexpiry_date string OptionalFormat:
date-timemax_usage integer Optionalrate_limit number or null Optionalspending_limit number or null Optionalnull when not set.created string OptionalFormat:
date-timeunique_organization_id string or null OptionalOpenAPI response schema
{
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "API key ID."
},
"name": {
"type": "string",
"description": "Key name."
},
"prefix": {
"type": "string",
"description": "Key prefix."
},
"is_test": {
"type": "boolean",
"description": "Test or production key."
},
"expiry_date": {
"type": "string",
"format": "date-time",
"description": "Expiry date."
},
"max_usage": {
"type": "integer",
"description": "Max usage count. -1 = unlimited."
},
"rate_limit": {
"type": "number",
"nullable": true,
"description": "Requests per minute. null uses the organization default."
},
"spending_limit": {
"type": "number",
"description": "Spending limit in USD. `null` when not set.",
"nullable": true
},
"created": {
"type": "string",
"format": "date-time",
"description": "When the API key was created."
},
"unique_organization_id": {
"type": "string",
"nullable": true,
"description": "Owning organization UUID."
}
},
"additionalProperties": true
}403
The API key is missing, invalid or expired, or the request changes limits.
application/json
$ object Body
detail string Required in parentOpenAPI response schema
{
"type": "object",
"required": [
"detail"
],
"properties": {
"detail": {
"type": "string"
}
}
}Example
{
"detail": "Limits can only be changed from the dashboard, or by an API key explicitly granted the matching 'limit_policies' permission. No API key can change the spending limit, rate limit, usage quota, or limit policies that cap the key itself."
}404
Not Found
application/json
$ object Body
error string Optional"Not found"OpenAPI response schema
{
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Not found"
}
}
}OpenAPI source
The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.
OpenAPI operation
{
"summary": "Update a temporary API key",
"operationId": "updateApiKey",
"tags": [
"Temporary API Keys"
],
"description": "Update an API key's name, expiry, usage, rate, or spending limit. With an API key you can change `name` and `expiry_date`. Changing `max_usage`, `rate_limit`, `spending_limit` or `limit_policies` needs the dashboard, or a key explicitly granted the `limit_policies` permission.",
"parameters": [
{
"name": "id",
"in": "path",
"required": true,
"schema": {
"type": "string"
},
"description": "The ID of the temporary API key to update."
}
],
"requestBody": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Key name."
},
"expiry_date": {
"type": "string",
"format": "date-time",
"description": "Expiry date (ISO 8601)."
},
"max_usage": {
"type": "integer",
"description": "Maximum use count. -1 means unlimited."
},
"rate_limit": {
"type": "number",
"nullable": true
},
"spending_limit": {
"type": "number",
"nullable": true
}
}
}
}
}
},
"responses": {
"200": {
"description": "Updated API key.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "API key ID."
},
"name": {
"type": "string",
"description": "Key name."
},
"prefix": {
"type": "string",
"description": "Key prefix."
},
"is_test": {
"type": "boolean",
"description": "Test or production key."
},
"expiry_date": {
"type": "string",
"format": "date-time",
"description": "Expiry date."
},
"max_usage": {
"type": "integer",
"description": "Max usage count. -1 = unlimited."
},
"rate_limit": {
"type": "number",
"nullable": true,
"description": "Requests per minute. null uses the organization default."
},
"spending_limit": {
"type": "number",
"description": "Spending limit in USD. `null` when not set.",
"nullable": true
},
"created": {
"type": "string",
"format": "date-time",
"description": "When the API key was created."
},
"unique_organization_id": {
"type": "string",
"nullable": true,
"description": "Owning organization UUID."
}
},
"additionalProperties": true
}
}
}
},
"403": {
"description": "The API key is missing, invalid or expired, or the request changes limits.",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"detail"
],
"properties": {
"detail": {
"type": "string"
}
}
},
"example": {
"detail": "Limits can only be changed from the dashboard, or by an API key explicitly granted the matching 'limit_policies' permission. No API key can change the spending limit, rate limit, usage quota, or limit policies that cap the key itself."
}
}
}
},
"404": {
"description": "Not Found",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"error": {
"type": "string",
"example": "Not found"
}
}
}
}
}
}
},
"security": [
{
"RespanApiKey": []
}
]
}OpenAPI path metadata
{}Referenced OpenAPI components
{
"securitySchemes": {
"RespanApiKey": {
"type": "http",
"scheme": "bearer",
"bearerFormat": "Respan API key",
"description": "Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.",
"x-fern-bearer": {
"name": "respanApiKey",
"env": "RESPAN_API_KEY"
}
}
}
}