Skip to main content
The pre.dev AI Gateway is a metered, OpenAI-compatible inference API. Point an OpenAI-compatible client at https://api.pre.dev/v1, send your pre.dev API key, and call any model in the pre.dev catalog — hundreds of models from every major lab — by the id listed in GET /v1/models. Calls are paid with pre.dev credits.

Quickstart

First request with curl, the OpenAI SDK, the Vercel AI SDK, or the Anthropic SDK.

API key

Where the key lives, which headers carry it, and how it reaches your deployed app.

Pricing

Credits per call, the trial allowance, and what happens when credits run out.

Models

Browse the catalog with credit prices attached.

What you send

Model ids are <author>/<slug> strings exactly as listed by GET /v1/models, for example anthropic/claude-sonnet-5, deepseek/deepseek-v4.1-flash, google/gemini-3.8-flash, or openai/gpt-5.6-luna. There are no separate pre.dev-specific model names. Variant suffixes such as :free, :nitro, :online, and :batch are accepted. The standard chat completion fields (messages, temperature, max_tokens, stop, and so on) work as you would expect. On top of those, the pre.dev AI API supports these advanced options, described on routing and fallbacks:

What the gateway changes

The gateway edits four things and nothing else:
  1. Replaces your pre.dev key with pre.dev’s own model-provider credentials.
  2. Sets stream_options.include_usage on streaming chat completions, so the final chunk carries usage.cost.
  3. Sets, or prefixes, the user field with a workspace hash for abuse attribution.
  4. Adds attribution headers.
Request and response bodies are otherwise the standard OpenAI-compatible shapes, and the Anthropic Messages shape on /v1/messages.

Endpoints

Response headers

Every inference call returns x-predev-request-id (pdr_…), x-predev-credits-charged, and x-predev-credits-remaining (omitted on unlimited plans). Send x-predev-project-id to attribute usage to one of your projects. See usage.

Billing in one line

1 credit = $0.10. Each call is charged in credits based on the model’s metered cost for that call, reported in usage.cost; the credit price per model is listed on GET /v1/models under predev.credits_per_m_input and predev.credits_per_m_output. Catalog reads are free. Details and the trial rule are on pricing.