Ana içeriğe geç

Get AI Gateway Settings

Endpoint

GET /apiops/settings/ai-gateway

Authentication

Requires a Personal API Access Token with admin privileges.

Authorization: Bearer YOUR_TOKEN

Request

Headers

HeaderValueRequired
AuthorizationBearer {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

FieldTypeDescription
statusstringResponse status: SUCCESS or FAILURE
resultListarrayList containing the single settings object
resultCountintegerAlways 1 for this singleton resource

Settings Object Fields

FieldTypeDefaultDescription
defaultBudgetobjectbudget disabledPlatform-wide default token/cost budget (see below). Proxy- or user-level overrides can supersede it.
defaultConnectTimeoutSecondsinteger10Connect timeout to the LLM provider, in seconds (1-300)
defaultStreamTimeoutSecondsinteger120Overall SSE stream timeout, in seconds (1-3600)
defaultRetryCountinteger0Retry attempts on provider error (0-10); 0 = no retry
maxAiRequestBodyBytesinteger10485760Max JSON AI request body size in bytes (10 MB default)
maxAiBinaryRequestBodyBytesinteger26214400Max binary/multipart AI request body size in bytes (25 MB default, e.g. audio transcription uploads)
maxAiBinaryResponseBodyBytesinteger26214400Max binary AI response body size in bytes (25 MB default, e.g. TTS/image-gen output)
maxToolTurnsinteger5Ceiling on chained agentic tool-call turns; <= 0 disables the loop (passthrough)

defaultBudget Object Fields

FieldTypeDescription
enabledbooleanWhether the default budget is enforced
tokensPerHourintegerHourly token cap (null = no limit)
tokensPerMinuteintegerPer-minute token cap (null = no limit)
tokensPerDayintegerDaily token cap (null = no limit)
tokensPerMonthintegerMonthly token cap (null = no limit)
monthlyBudgetUsdnumberMonthly USD cost cap (null = no limit)
usdPerHournumberHourly USD cost cap (null = no limit)
usdPerDaynumberDaily USD cost cap (null = no limit)
softCapPercentsarray[integer]Soft-cap warning thresholds, each in [0, 100]
hardCapPercentintegerHard-cap threshold in [1, 100]
overflowActionstringAction on overflow: BLOCK, FAILOVER, ALERT_ONLY, CHEAPER_MODEL
cheaperModelIdstringFallback model id used when overflowAction = CHEAPER_MODEL
modelBudgetsarrayPer-model budget overrides
providerBudgetsarrayPer-provider budget overrides

EnumStatus

  • SUCCESS - Operation successful
  • FAILURE - 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 ADMIN role) can read AI Gateway settings
    • A project-scoped AI_DEVELOPMENT token is not sufficient
  • Singleton:
    • A single document governs the entire platform; resultCount is always 1
    • If no document exists yet, defaults are returned (a new document is not persisted on read)
  • 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