Connect Vercel AI SDK to Anoman AI
The Vercel AI SDK talks to Anoman through its OpenAI-compatible (or Anthropic) provider — generateText and streamText work unchanged.
Prerequisites
- An Anoman API key — create one in the dashboard (format
anm-sk-…). - Vercel AI SDK installed and up to date.
- A model ID from the Anoman catalog, e.g.
gpt-4o,gpt-4o-mini, orclaude-sonnet-4-6.
Enable streaming for long agent runs
Set stream: true on requests. Autonomous, multi-step, and long-thinking tasks can exceed the 100-second edge timeout and fail with a 524 error; streaming returns tokens as they are generated and keeps the connection alive, so the request completes. Most tools stream by default — confirm it is on for agentic use.
More detail in the streaming guide.
Create an Anoman provider
Use createOpenAICompatible from @ai-sdk/openai-compatible with Anoman's base URL and key.
Prefer Anthropic?
Use createAnthropic from @ai-sdk/anthropic with Anoman's Anthropic base URL.
Verify the guardrails are active
Every Anoman response carries guardrail result headers. Inspect them in your dashboard traces to confirm the pipeline is running on Vercel AI SDK requests — prompt-injection detection, PII masking, and content moderation all apply automatically.
Need help with your integration?
Join the Founding 50 for early access and direct support from the Anoman team.