gateway api
Proxy endpoints
The gateway speaks both major API shapes at one host. Request and response bodies are the providers' own formats — these docs only describe what Understudy adds around them.
Endpoint summary
| endpoint | shape | notes |
|---|---|---|
POST /v1/messages | Anthropic Messages | Streaming and non-streaming. BYO or managed. |
POST /v1/chat/completions | OpenAI Chat Completions | Streaming and non-streaming. BYO or managed. Catalog models are requested here by id. |
POST /v1/messages/count_tokens | Anthropic token counting | Compatibility shim, proxied to Anthropic. |
GET /v1/models | OpenAI model list | The public model catalog — ids your key can request in managed mode. |
GET /healthz | — | Public liveness probe. No auth. |
Compatibility contract
In passthrough, bodies forward unmodified and responses return unmodified — your SDK cannot tell the gateway is there beyond the extra response headers. When a request is routed, the gateway rewrites body.model to the serving model; the original value is preserved in the capture envelope as requested_model, and the served one is reported on x-understudy-effective-model.
GET /v1/models
curl https://api.understudylabs.com/v1/models \
-H "Authorization: Bearer $UNDERSTUDY_API_KEY"{
"object": "list",
"data": [
{
"id": "glm-5.1",
"object": "model",
"created": 1764892800,
"owned_by": "understudy",
"display_name": "GLM 5.1"
}
]
}Catalog ids are public names — they carry no provider, endpoint, or deployment details. Understudy resolves the serving provider behind each id and may change it without the id changing.