# Vercel AI Gateway

Category: [AI models and chat](https://free-web-services.com/web-services/ai/llm/)  
Page: https://free-web-services.com/web-services/ai/llm/vercel-ai-gateway.html  
Documentation: https://vercel.com/docs/ai-gateway

Vercel AI Gateway gives one OpenAI-compatible and Anthropic-compatible endpoint for hundreds of models from OpenAI, Google, Anthropic, Meta, Mistral and others, with fallback between providers. POST JSON to /v1/chat/completions with the key as a Bearer token. Free with a free API key and a monthly included credit for a subset of models, at lower rate limits; Vercel may ask for a payment method before the free credit can be used. Buying credits ends the monthly free credit.

- API key: Needed, free
- Pricing: Free with a free API key and a monthly included credit for a subset of models, at lower rate limits; Vercel may ask for a payment method before the free credit can be used.
- From the browser: No, call it from a server
- Formats: JSON
- Interface: REST
- Provider: vercel.com

Example request:

```sh
curl -X POST 'https://ai-gateway.vercel.sh/v1/chat/completions' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"model":"openai/gpt-oss-20b","messages":[{"role":"user","content":"Say hello in one word."}],"max_tokens":20}'
```

Replace YOUR_API_KEY with your own key. Run the JavaScript on a server, such as Node.js 18 or newer: this API does not accept calls from web pages on other sites.

