Starport

Errors and limits

Read the error body of each API family, and learn the status codes for authentication, scopes, rate limits, budgets, request size, and guardrails.

Starport writes each error in the format of the API family that the client called. A client of the OpenAI family gets an OpenAI error object. A client of the OpenRouter family gets an OpenRouter error object.

Error bodies

OpenAI family, under /v1:

{
  "error": {
    "message": "Insufficient API key scope",
    "type": "permission_error"
  }
}

The object can also contain param and code.

OpenRouter family, under /api/v1:

{
  "error": {
    "code": 403,
    "message": "Insufficient API key scope",
    "metadata": { "error_type": "permission_error" }
  }
}

The OpenRouter code is the HTTP status. The error_type value is the same as the OpenAI type value.

Status codes

StatusTypeMessage or cause
400invalid_request_errorThe request is not valid. A guardrail refusal also uses 400.
401authentication_errorNot authenticated
402permission_errorInsufficient quota: <scope> <dimension> budget exhausted for the current <interval> window
403permission_errorInsufficient API key scope or Admin access required
404not_found_errorThe requested endpoint does not exist, or a resource does not exist
405invalid_request_errorMethod not allowed
413invalid_request_errorRequest body is <n> bytes, above the <limit> byte limit
429rate_limit_errorRate limit exceeded: <scope> request limit
503server_errorFor example, The catalog is not available.

A 402 error is a budget refusal, not a provider payment error. The <scope> value is account, key, or team.

Rate limits

Starport counts requests for each account, key, and team that has a request limit. The tightest limit sets the response headers:

HeaderMeaning
X-RateLimit-LimitThe request limit of the window
X-RateLimit-RemainingThe requests that remain in the window
X-RateLimit-ResetThe end of the window
X-RateLimit-Scopeaccount, key, or team
Retry-AfterSeconds to wait. A 429 response adds it.
SettingDefault
STARPORT_SECURITY_ENABLE_RATE_LIMITINGtrue
STARPORT_RATE_LIMITING_DEFAULT_REQUESTS_PER_MINUTE60
STARPORT_RATE_LIMITING_WINDOW_SIZE1m

A 429 response tells the client to wait. Send the request again after the Retry-After value.

Budgets

A budget limits spend or tokens for an account, a key, or a team in an interval. Starport reserves budget before each provider attempt. STARPORT_BUDGET_ADMISSION_MODE=atomic is the only supported mode. Only routes that start paid work check a budget. A read of a job or a file does not.

These headers report the state of each budget:

HeaderMeaning
X-Starport-Budget-Spend-Limit, -Remaining, -Reset, -ScopeThe spend budget, in nano-USD
X-Starport-Budget-Tokens-Limit, -Remaining, -Reset, -ScopeThe token budget

A cache hit does not skip a required budget check. Refer to Keys and roles for the scopes and limits of a key.

Request limits

SettingDefaultEffect
STARPORT_SERVER_MAX_REQUEST_SIZE33554432The largest request body in bytes. A larger body gets 413.
STARPORT_SERVER_REQUEST_TIMEOUT60sThe time limit of one request
STARPORT_FILES_MAX_UPLOAD_BYTES536870912The largest file upload in bytes

Guardrails

Guardrails are off until STARPORT_GUARDRAILS_CHECKS names a check. The pii check finds email addresses, phone numbers, card numbers, and US social security numbers. Its mode is redact (the default) or refuse. The moderation check sends the text to a moderation model and refuses a score at or above the threshold.

STARPORT_GUARDRAILS_CHECKS=pii,moderation
STARPORT_GUARDRAILS_PII_MODE=redact
STARPORT_GUARDRAILS_MODERATION_MODEL=<provider>/<moderation-model>

A refusal returns 400 with the check name. A check that cannot run refuses the text. The moderation model must be a callable offering, and its call has its own usage record. Refer to the operator guide.

Limitations

  • Neither family has a /messages route.
  • The OpenRouter family has no image edit, audio translation, moderation, file, or batch route.
  • The model lists show only routable offerings. A catalog model without a price, a ready adapter, or support is not in the list.
  • A listed model can still fail at the provider. The model list does not test credentials.
  • Discovery readiness is always unknown in this release.

Refer to Supported API surfaces for each route.

On this page