Endpoints

Modal Endpoints let you deploy models from the Modal Library—or your own custom weights—as production-ready inference APIs.

  • Fast inference — tuned open-source serving engines, with speculative decoding where supported, behind Modal’s low-latency request proxy.
  • Managed infrastructure — Modal handles provisioning, routing, and capacity management.
  • Open and inspectable — use familiar OpenAI- and Anthropic-compatible APIs; inspect or adapt the generated source behind a Dedicated Endpoint.

Choose between two serving modes:

Shared EndpointsDedicated Endpoints
Best forFast, fully managed inferenceIsolated capacity and custom models
ModelsSelected models from the Modal LibraryAll Modal Library models, plus custom weights
BillingPer tokenCompute resources
CapacityManaged by ModalConfigurable autoscaling, including scale-to-zero

Create an endpoint 

Browse the Modal Library to choose a model and see which serving modes it supports. Then create an Endpoint from the Endpoints tab in the dashboard.

Proxy tokens 

Shared Endpoints always require a Proxy Token. Dedicated Endpoints require one by default. Create one with the CLI:

modal workspace proxy-tokens create

Join the token ID and secret with a period (.) and pass them as a bearer token:

Authorization: Bearer wk-<id>.ws-<secret>

The combined value can be used as the API key in an OpenAI-compatible client. See Proxy Tokens for environment scoping and other authentication options. Dedicated Endpoints can also be created with --unauthenticated.

Call an endpoint 

Text-generation models on both Shared and Dedicated Endpoints can be called through the OpenAI-compatible Chat Completions and Responses APIs or the Anthropic-compatible Messages API. Embedding models can be called through the OpenAI-compatible Embeddings API.

The dashboard shows the Endpoint URL and model name. This example uses the Chat Completions API and a proxy token:

curl "<your-endpoint-url>/v1/chat/completions" \
  -H "Authorization: Bearer $MODAL_PROXY_TOKEN_ID.$MODAL_PROXY_TOKEN_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<model-name>",
    "messages": [{ "role": "user", "content": "Hello!" }]
  }'

See Endpoint integrations for connecting coding agents like OpenCode and Codex to a Shared Endpoint.