Skip to main content

LangGraph

LangGraph is available on the Spanway gateway through the langgraph/ model prefix. You register a LangGraph model once in the gateway's config.yaml (or through the Admin UI), and every application then calls it through the gateway's OpenAI-compatible API with a Spanway virtual key. The provider credential stays on the gateway, and every request is authenticated, rate limited, logged and costed in the same way as any other provider.

Unless you override it, the integration sends requests to http://localhost:2024. Set api_base in spanway_params to point at a different region, a private endpoint or a self-hosted deployment.

The gateway translates requests and responses for LangGraph natively, so provider specific parameters and errors are mapped to the OpenAI format for you.

Supported endpoints​

The gateway's endpoint support matrix lists the following endpoints for LangGraph. Each link explains the request shape and the gateway features that apply to that endpoint.

Environment variables​

The LangGraph integration reads the following environment variables. Variables marked as required are the ones the gateway's environment validation checks for this provider. You can also pass any of these values directly in spanway_params (for example api_key or api_base), and the per-model value wins over the environment.

VariableRequiredPurpose
LANGGRAPH_API_BASENoOverrides the provider base URL
LANGGRAPH_API_KEYNoCredential the gateway sends to the provider

Reference a variable from config.yaml with the os.environ/ prefix so that the secret never appears in the file itself. Secrets can also come from a secret manager, see secret managers.

Pricing​

The price map bundled with this Spanway build has no entries for LangGraph. Without a price the gateway still serves and logs requests, but it cannot compute their cost. Add input_cost_per_token and output_cost_per_token to the deployment to enable spend tracking, as described in custom pricing.