Hosts & Gateways
Vercel AI Gateway
Put Verdictan in front of Vercel AI Gateway. Your application calls Verdictan, which applies your policies, and then Vercel AI Gateway sends the request to the model provider it picks.
Use the full provider/model ID from Vercel, in the configuration and in each request. Verdictan does not add or resolve the provider segment.
Before you start
- A working gateway from the quickstart.
- A Vercel AI Gateway API key, and one model ID in Vercel's
provider/modelform. - The gateway startup command, and a separate application token for test requests.
Configure the provider
Set base_url to the Vercel AI Gateway origin, without /v1:
pack:
name: vercel-integration
version: 1.0.0
enabled: true
policies:
chain:
- prompt-injection
providers:
targets:
- id: vercel-primary
provider: vercel
model: "replace-with-provider/model"
base_url: https://ai-gateway.vercel.sh
secret_key_ref:
env: VERDICTAN_VERCEL_API_KEYThe gateway appends the path for each request family, such as /v1/chat/completions, and sends the key from VERDICTAN_VERCEL_API_KEY as a Bearer token.
Start and verify
The Vercel target can also use the CLI 0.1.14 deployment procedure. Check In sync, then send the request below to test the configured route through Vercel.
With the quickstart in Docker, follow the container steps instead of steps 1 to 3.
-
In the gateway terminal, set the key and lint the file:
export VERDICTAN_VERCEL_API_KEY="<provider-api-key>" verdictan policy lint --file policy-config.yaml -
Restart the test gateway with the key in its environment.
-
Deploy the file to the test agent in Configurations. If that agent already runs
pack.version1.0.0, increase the version first. Then wait for the gateway log lineconnected read model refresh applied updated configwith your version asconfig_version. Try the change on a test gateway has the steps. -
In a second terminal, send a request with the full model ID:
export VERDICTAN_CLIENT_TOKEN="<application-token>" curl --fail-with-body http://127.0.0.1:41002/v1/chat/completions \ -H "Authorization: Bearer ${VERDICTAN_CLIENT_TOKEN}" \ -H "Content-Type: application/json" \ -d '{"model":"replace-with-provider/model","messages":[{"role":"user","content":"Reply with Hello."}]}'
choices[0].message.content contains the reply, and the request appears in History when capture is on, or in the delivered events.
Supported requests
| Request | Support |
|---|---|
| Chat Completions | Yes. Streaming and tools work if the model supports them. |
| Messages | Translated to Chat Completions |
| Embeddings | Yes, with a second target for an embedding model |
Responses, audio, image input, response_format, parallel tool calls | No, even where Vercel supports them directly |
The gateway authenticates embeddings requests and applies provider access and budget rules, but your policy chain does not run on them. Only Chat Completions, Responses, and Messages go through the chain.
Failure behavior
| Problem | What to check |
|---|---|
401 from the gateway | The application token is active, and the key is set on the gateway host. |
| Provider authentication error | VERDICTAN_VERCEL_API_KEY is set in the gateway process. Restart the gateway. |
404 from Vercel | base_url has no /v1. |
| Model not found | The request uses the full provider/model ID, and it matches the target. |
capability.unsupported_family | The request uses a family from the table. |
Provider 429 or another upstream error | The response body and your Vercel limits. See Error Handling. |
Limits
- Model names, prices, rate limits, and data terms are in the Vercel AI Gateway documentation.
- Vercel picks the upstream provider and its data terms after Verdictan policies run.
- Streaming and tools vary by model. Test each one with your model.
- A listener on a non-loopback address needs TLS and network controls.
Next steps
- OpenRouter: another multi-provider router.
- Provider Configuration: target fields, routing, and fallback.