Reveal an API Key
GET /api/open/v1/keys/:id/keyReturns the same Key object as Get an API Key, except that key is the full sk-... value instead of the masked form. Use it when a third-party integration needs to save or rotate a Key without asking the user to copy the value from the console.
Request parameters
Section titled “Request parameters”| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | Yes | Key ID, a positive integer |
Request example
Section titled “Request example”curl https://www.routeapi.ai/api/open/v1/keys/12/key \ -H "Authorization: Bearer $ROUTEAPI_MANAGEMENT_KEY"Response example
Section titled “Response example”{ "success": true, "message": "", "data": { "id": 12, "name": "bot", "key": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "status": 1, "created_time": 1729000000, "accessed_time": 1729000000, "expired_time": -1, "remain_amount": 10.00, "unlimited": false, "used_amount": 0.00, "model_limits_enabled": false, "model_limits": "", "allow_ips": "" }}The response carries Cache-Control: no-store so that neither browsers nor proxies cache the plaintext Key. For field descriptions, see the Key object.
Errors
Section titled “Errors”| HTTP | code | Scenario |
|---|---|---|
| 400 | invalid_request | id is not a positive integer |
| 403 | insufficient_scope | The Management Key does not have the permission this endpoint requires |
| 404 | not_found | The Key does not exist or does not belong to you |
| 429 | rate_limited | Per-Management-Key rate limit exceeded |
| 429 | — | Per-client-IP rate limit exceeded (default 100 requests/20 minutes for sensitive endpoints); the response body may be empty |
For other common error codes, see Platform API errors.
- Every successful call writes an audit event (
open_api.key.reveal) that records the Key ID and name and the Management Key used. Plaintext Keys are never written to audit events or logs. - This endpoint is subject to stricter rate limiting than ordinary read endpoints, because it returns secrets.
- The full Key is also returned once by Create an API Key. Prefer storing it at creation time and calling this endpoint only when the stored value was lost or must be rotated.
- Get an API Key and List API Keys keep returning the masked value.