API Keys
Manage API keys for authenticating requests to the agent-swarm.dev API
Authorization
bearerAuth API key via Authorization: Bearer <API_KEY>
In: header
Query Parameters
1 <= valueResponse 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
}{
"error": "string",
"property1": null,
"property2": null
}{
"error": "string",
"property1": null,
"property2": null
}Authorization
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
}Authorization
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
}Authorization
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
}Authorization
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
}Authorization
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
}Authorization
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
}Authorization
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"
}
},
"createdAt": "string",
"updatedAt": "string"
}
]
}{
"error": "string",
"property1": null,
"property2": null
}