API Keys
Manage API keys for authenticating requests to the agent-swarm.dev API
/api/keys/availableAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Query Parameters
1 <= value"fable" | "opus" | "sonnet" | "haiku"Response Body
application/json
application/json
application/json
curl -X GET "http://localhost:3013/api/keys/available?keyType=string&totalKeys=1"{
"success": true,
"availableIndices": [
0
],
"totalKeys": 0,
"modelBlockedIndices": [
0
],
"earliestModelResetAt": "string",
"seatBlockedIndices": [
0
],
"authFailureFence": 0
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/clear-rate-limitAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/keys/clear-rate-limit" \ -H "Content-Type: application/json" \ -d '{ "keyType": "string", "keySuffix": "string" }'{
"success": true,
"cleared": true,
"message": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/costsAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Query Parameters
Response Body
application/json
application/json
curl -X GET "http://localhost:3013/api/keys/costs"{
"success": true,
"costs": [
{
"keyType": "string",
"keySuffix": "string",
"totalCost": 0,
"totalInputTokens": 0,
"totalOutputTokens": 0,
"taskCount": 0
}
]
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/nameAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X PATCH "http://localhost:3013/api/keys/name" \ -H "Content-Type: application/json" \ -d '{ "keyType": "string", "keySuffix": "string", "name": "string" }'{
"success": true,
"keyType": "string",
"keySuffix": "string",
"name": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/planAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X PATCH "http://localhost:3013/api/keys/plan" \ -H "Content-Type: application/json" \ -d '{ "keyType": "string", "keySuffix": "string", "plan": "string" }'{
"success": true,
"keyType": "string",
"keySuffix": "string",
"plan": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/plansAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Response Body
application/json
curl -X GET "http://localhost:3013/api/keys/plans"{
"checkedAt": "string",
"plans": [
{
"id": "string",
"label": "string",
"keyType": "string",
"monthlyUsd": 0
}
]
}/api/keys/report-auth-failureAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/keys/report-auth-failure" \ -H "Content-Type: application/json" \ -d '{ "keyType": "string", "keySuffix": "string", "keyIndex": 0 }'{
"success": true,
"consecutiveAuthFailures": 0,
"benched": true,
"rateLimitedUntil": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/report-rate-limitAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/keys/report-rate-limit" \ -H "Content-Type: application/json" \ -d '{ "keyType": "string", "keySuffix": "string", "keyIndex": 0, "rateLimitedUntil": "2019-08-24T14:15:22Z" }'{
"success": true,
"message": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/report-rate-limit-windowsAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/keys/report-rate-limit-windows" \ -H "Content-Type: application/json" \ -d '{ "keyType": "string", "keySuffix": "string", "keyIndex": 0, "windows": { "property1": { "status": "string", "lastSeenAt": "2019-08-24T14:15:22Z" }, "property2": { "status": "string", "lastSeenAt": "2019-08-24T14:15:22Z" } } }'{
"success": true,
"message": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/report-seat-mismatchAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/keys/report-seat-mismatch" \ -H "Content-Type: application/json" \ -d '{ "keyType": "string", "keySuffix": "string", "keyIndex": 0, "model": "fable" }'{
"success": true,
"message": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/report-usageAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:3013/api/keys/report-usage" \ -H "Content-Type: application/json" \ -d '{ "keyType": "string", "keySuffix": "string", "keyIndex": 0 }'{
"success": true,
"message": "string"
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}/api/keys/statusAuthorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Query Parameters
Response Body
application/json
application/json
curl -X GET "http://localhost:3013/api/keys/status"{
"success": true,
"keys": [
{
"id": "string",
"keyType": "string",
"keySuffix": "string",
"keyIndex": 0,
"scope": "string",
"scopeId": "string",
"status": "string",
"rateLimitedUntil": "string",
"lastUsedAt": "string",
"lastRateLimitAt": "string",
"totalUsageCount": 0,
"rateLimitCount": 0,
"name": "string",
"provider": "string",
"rateLimitWindows": {
"property1": {
"status": "string",
"utilization": 0,
"resetsAt": 0,
"isUsingOverage": true,
"surpassedThreshold": 0,
"lastSeenAt": "2019-08-24T14:15:22Z"
},
"property2": {
"status": "string",
"utilization": 0,
"resetsAt": 0,
"isUsingOverage": true,
"surpassedThreshold": 0,
"lastSeenAt": "2019-08-24T14:15:22Z"
}
},
"plan": "string",
"planSource": "manual",
"lastSeatMismatchAt": "string",
"lastSeatMismatchModel": "string",
"consecutiveAuthFailures": 0,
"lastAuthFailureAt": "string",
"modelLimits": [
{
"model": "string",
"window": "string",
"resetsAt": 0,
"resetsAtIso": "string",
"active": true
}
],
"createdAt": "string",
"updatedAt": "string"
}
]
}{
"error": "string",
"property1": null,
"property2": null
}