Get AI Gateway Settings
Endpoint
GET /apiops/settings/ai-gateway
Authentication
Requires a Personal API Access Token with admin privileges.
Header
Authorization: Bearer YOUR_TOKEN
Request
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
Path Parameters
None.
Query Parameters
None.
Response
Success Response (200 OK)
The settings are returned as a single object inside resultList. Entity getters are null-safe, so the response always carries the effective value: any field that has never been set is returned with its platform default rather than null.
{
"status": "SUCCESS",
"resultList": [
{
"defaultBudget": {
"enabled": false,
"tokensPerHour": null,
"tokensPerMinute": null,
"tokensPerDay": null,
"tokensPerMonth": null,
"monthlyBudgetUsd": null,
"usdPerHour": null,
"usdPerDay": null,
"softCapPercents": [],
"hardCapPercent": null,
"overflowAction": "BLOCK",
"cheaperModelId": null,
"modelBudgets": [],
"providerBudgets": []
},
"defaultConnectTimeoutSeconds": 10,
"defaultStreamTimeoutSeconds": 120,
"defaultRetryCount": 0,
"maxAiRequestBodyBytes": 10485760,
"maxAiBinaryRequestBodyBytes": 26214400,
"maxAiBinaryResponseBodyBytes": 26214400,
"maxToolTurns": 5
}
],
"resultCount": 1
}
Response Fields
| Field | Type | Description |
|---|---|---|
| status | string | Response status: SUCCESS or FAILURE |
| resultList | array | List containing the single settings object |
| resultCount | integer | Always 1 for this singleton resource |
Settings Object Fields
| Field | Type | Default | Description |
|---|---|---|---|
| defaultBudget | object | budget disabled | Platform-wide default token/cost budget (see below). Proxy- or user-level overrides can supersede it. |
| defaultConnectTimeoutSeconds | integer | 10 | Connect timeout to the LLM provider, in seconds (1-300) |
| defaultStreamTimeoutSeconds | integer | 120 | Overall SSE stream timeout, in seconds (1-3600) |
| defaultRetryCount | integer | 0 | Retry attempts on provider error (0-10); 0 = no retry |
| maxAiRequestBodyBytes | integer | 10485760 | Max JSON AI request body size in bytes (10 MB default) |
| maxAiBinaryRequestBodyBytes | integer | 26214400 | Max binary/multipart AI request body size in bytes (25 MB default, e.g. audio transcription uploads) |
| maxAiBinaryResponseBodyBytes | integer | 26214400 | Max binary AI response body size in bytes (25 MB default, e.g. TTS/image-gen output) |
| maxToolTurns | integer | 5 | Ceiling on chained agentic tool-call turns; <= 0 disables the loop (passthrough) |
defaultBudget Object Fields
| Field | Type | Description |
|---|---|---|
| enabled | boolean | Whether the default budget is enforced |
| tokensPerHour | integer | Hourly token cap (null = no limit) |
| tokensPerMinute | integer | Per-minute token cap (null = no limit) |
| tokensPerDay | integer | Daily token cap (null = no limit) |
| tokensPerMonth | integer | Monthly token cap (null = no limit) |
| monthlyBudgetUsd | number | Monthly USD cost cap (null = no limit) |
| usdPerHour | number | Hourly USD cost cap (null = no limit) |
| usdPerDay | number | Daily USD cost cap (null = no limit) |
| softCapPercents | array[integer] | Soft-cap warning thresholds, each in [0, 100] |
| hardCapPercent | integer | Hard-cap threshold in [1, 100] |
| overflowAction | string | Action on overflow: BLOCK, FAILOVER, ALERT_ONLY, CHEAPER_MODEL |
| cheaperModelId | string | Fallback model id used when overflowAction = CHEAPER_MODEL |
| modelBudgets | array | Per-model budget overrides |
| providerBudgets | array | Per-provider budget overrides |
EnumStatus
SUCCESS- Operation successfulFAILURE- Operation failed
Error Response (400 Bad Request)
Returned when the caller is authenticated but lacks the ADMIN role.
{
"status": "FAILURE",
"resultMessage": "Unauthorized! Only users with ADMIN role can access this resource!"
}
Error Response (401 Unauthorized)
{
"status": "FAILURE",
"resultMessage": "Token is not valid!"
}
Causes
- Missing or invalid Authorization header
- Token expired or revoked
- Invalid token format
cURL Example
curl -X GET \
"https://demo.apinizer.com/apiops/settings/ai-gateway" \
-H "Authorization: Bearer YOUR_TOKEN"
Notes and Warnings
- Admin Only:
- Only sysAdmin users (or users with the
ADMINrole) can read AI Gateway settings - A project-scoped
AI_DEVELOPMENTtoken is not sufficient
- Only sysAdmin users (or users with the
- Singleton:
- A single document governs the entire platform;
resultCountis always1 - If no document exists yet, defaults are returned (a new document is not persisted on read)
- A single document governs the entire platform;
- Effective Values:
- Getters are null-safe, so the response always reflects the effective value in force (platform default when a field was never explicitly set)
- No Secret Fields:
- This settings document carries no secret (
@SecretData) fields, so no values are masked
- This settings document carries no secret (
Related Documentation
- Update AI Gateway Settings - Update these settings
- AI Gateway Settings API - Resource overview
- Authentication Guide - How to obtain and use API tokens