API reference - Keys
Create a key
Create an API key. The raw secret is returned once.
POST/api/v1/keys
The only time the full secret is ever returned. Scopes are clamped to what your plan allows; unknown scopes are a 400.
Request
{
"name": "my-bot",
"scopes": ["accounts:read", "rooms:read", "trades:read"],
"environment": "live",
"ipAllowlist": [],
"expiresAt": null,
"rateLimitRpm": nullResponse
{
"success": true,
"data": {
"keyId": "2e10ecae",
"keyPrefix": "tw_live_2e10ecae",
"name": "my-bot",
"scopes": ["accounts:read"],
"status": "active",
"rateLimitRpm": 120,
"key": "tw_live_2e10ecae_XXXX..."
},
"message": "Store this key now - it cannot be shown again."
}Note - Errors: 402 api_not_included, 402 key_limit_reached, 403 scope_not_in_plan, 400 unknown scope.







