openai, @anthropic-ai/sdk) pointed at Verlon’s drop-in gateway routes — see the OpenAI SDK integration guide and the Anthropic SDK integration guide. The Verlon SDK’s job is to make those calls observable and attributable, not to make them.
Installation
Get Your API Key
- Sign up at verlon.ai/signup
- Get your API key from the Dashboard
- Store it in an environment variable
.env
Quickstart: Trace an Agent
Create a client, get a handle for your agent gate, declare the tasks it performs, and open a trace scope. Any LLM call made inside the scope withtask.clientOptions() carries gate and task attribution and lands on the trace timeline automatically.
clientOptions('openai' | 'anthropic') returns { baseURL, fetch, defaultHeaders } to spread into the official SDK’s constructor:
baseURLroutes the call through the Verlon gateway (the provider hint sets the right base path for each SDK).defaultHeaderscarries the gate and task identity.fetchis an instrumented wrapper that injects the active trace context per call, so a client constructed once never pins a stale trace.
agent.clientOptions(...) instead of a task’s when a call belongs to the agent but no specific task. Everything the trace records — spans, timing, cost, model choice — appears on the gate’s timeline in the dashboard. See Agent Gates for the platform side.
Other HTTP clients
For an HTTP client that accepts a customfetch, verlon.instrumentFetch() returns the same instrumented wrapper on its own. For clients that don’t, ambientHeaders() (exported from the package root) returns the active trace context as plain headers — call it per request, inside the trace scope:
Tool Spans
Wrap a function withverlon.tool() and each execution becomes a tool span on the active trace, with arguments, timing, and errors recorded. Outside a trace scope the wrapper is a pure pass-through; errors are rethrown unchanged.
Model Registry
verlon.models() fetches the platform’s current model registry — models, capabilities, and pricing. It’s unauthenticated (the registry is public), so it’s safe to call before a key is configured.
MODEL_REGISTRY constant when the answer matters at runtime: the constant is a snapshot frozen at publish time (it exists to generate the ModelId union at compile time), while models() asks the platform.
Configuration
TypeScript Support
The SDK is fully typed. The tracing surface (AgentHandle, TaskHandle, trace options), the registry snapshot, and the ModelId union are all exported from the package root:
Deprecated: Inference Methods
Setup and migration guides:OpenAI SDK Integration
Point the openai package at Verlon
Anthropic SDK Integration
Point the Anthropic SDK at Verlon
OpenAI Compatibility
Supported routes and parameters
Anthropic Compatibility
Supported routes and parameters
Video and OCR have drop-in mirrors too: the
openai package’s async Videos surface (videos.create / retrieve / downloadContent) against /v1/videos, and mistral.ocr.process() against /mistral/v1/ocr. The migration guide has the full method-by-method table.Next Steps
Agent Gates
Traces, tasks, and sessions on the platform
Creating Gates
Configure gates in the dashboard
Migration Guide
Method-by-method replacements for the deprecated inference surface

