Skip to navigation

Models

Meadow serves four model formats. Each one takes a provider’s own request format and returns that provider’s own response. You send your Meadow API key, and Meadow uses the provider key you stored.

Next step: store a provider key (Provider keys), then run the first call below.

curl -sS "$MEADOW_BASE_URL/v1/chat/completions" \
-H "Authorization: Bearer $MEADOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gemini-3.1-flash-lite-preview",
"messages": [{"role": "user", "content": "Say hello in five words."}],
"max_tokens": 32
}'
{"choices":[{"finish_reason":"stop","index":0,"message":{"content":"Hello, it is nice meeting.","extra_content":{"google":{"thought_signature":"EqkBCqYB..."}},"role":"assistant"}}],"created":1795472115,"id":"8roEa7-Y...","model":"gemini-3.1-flash-lite-preview","object":"chat.completion","usage":{"completion_tokens":7,"prompt_tokens":7,"total_tokens":14}}

That body is Google’s answer, byte for byte. Meadow adds three response headers:

x-meadow-provider: google
x-meadow-model: gemini-3.1-flash-lite-preview
x-meadow-attempts: 1

The formats

EndpointFormatUse it when
POST /v1/chat/completionsOpenAI Chat CompletionsYour code uses the OpenAI SDK’s chat.completions, or you want the format most providers accept.
POST /v1/responsesOpenAI ResponsesYour code uses the OpenAI SDK’s responses, or a tool that speaks only Responses, such as the Codex CLI.
POST /v1/messagesAnthropic MessagesYour code uses the Anthropic SDK or Claude Code.
POST /v1beta/models/{model}:generateContent and :streamGenerateContentGoogle Gemini generateContentYour code uses gemini-cli or a Google GenAI SDK. See Gemini clients. Not on the hosted beta yet.

Meadow does not convert between formats. A request goes only to providers that accept the format you sent. This table shows which provider accepts which format:

ProviderChat CompletionsResponsesMessagesGemini generateContent
anthropicnonoyesno
openaiyesyesnono
googleyesnonoyes
xaiyesyesyesno
openrouteryesyesyesno
azureyesyesyesno
bedrockyes (a pinned ID, not Claude)yes (a pinned ID, models AWS lists for it)yes (Claude)no
vertexyes (Gemini)noyes (Claude)yes (Gemini)
fireworksyesyesyesno
deepseekyesyesyesno

Bedrock serves Chat Completions and Responses on its OpenAI-compatible route for the models it hosts other than Claude, such as bedrock/openai.gpt-oss-120b-1:0. None of them is in GET /v1/models, so pin the ID. Meadow holds no price for them. So a Claude model on /v1/chat/completions can only be served by OpenRouter, and a Gemini model on /v1/messages can only be served by OpenRouter. When no provider accepts the format for the model, you get a 400. A pinned ID counts only the pinned provider:

curl -sS "$MEADOW_BASE_URL/v1/chat/completions" \
-H "Authorization: Bearer $MEADOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "anthropic/claude-haiku-5-5", "messages": [{"role": "user", "content": "hi"}], "max_tokens": 32}'
{"error":{"message":"no provider accepts this format for the requested model","type":"invalid_request_error","param":null,"code":"invalid_request"},"request_id":"req_0000aa38"}

What was run on the hosted beta for this page: Google (Chat Completions), xAI (all three formats), Anthropic (Messages), and OpenRouter (all three formats), each blocking and streamed. OpenAI direct, Azure, and Bedrock have not served a call through the beta. Fireworks and DeepSeek have served no real call at all: Meadow follows their published documents. Claude on Vertex was served on a test server with an operator’s Google token, not with a stored service account key. See Known limits.

Responses

curl -sS "$MEADOW_BASE_URL/v1/responses" \
-H "Authorization: Bearer $MEADOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "grok-4.7", "input": "Say hello in five words.", "max_output_tokens": 64}'
{"created_at":1795472127,"completed_at":1795472128,"id":"68a782f0-...","max_output_tokens":64,"model":"grok-4.7","object":"response","output":[{"id":"rs_0000c06b-...","summary":[{"text":"The user wants a greeting in five words.","type":"summary_text"}],"type":"reasoning","status":"completed","encrypted_content":"D9Goh..."},{"content":[{"type":"output_text","text":"Hello there, hope you're well.","logprobs":[],"annotations":[]}],"id":"msg_0000c06b-...","role":"assistant","type":"message","status":"completed"}],"usage":{"input_tokens":1248,"output_tokens":73,"total_tokens":1321}}

The output is trimmed. Meadow keeps no response state. A request with previous_response_id must pin one provider (see Pin a provider), or it gets a 400 previous_response_id requires pinning a single provider.

Messages

max_tokens is required, as it is at Anthropic. x-api-key works in place of Authorization, so Anthropic clients need no change.

curl -sS "$MEADOW_BASE_URL/v1/messages" \
-H "x-api-key: $MEADOW_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-haiku-5-5",
"max_tokens": 64,
"messages": [{"role": "user", "content": "Say hello in five words."}]
}'
{"model":"claude-haiku-5-5","id":"msg_00007279...","type":"message","role":"assistant","content":[{"type":"text","text":"Hello there, my friend!"}],"stop_reason":"end_turn","stop_sequence":null,"usage":{"input_tokens":16,"cache_creation_input_tokens":0,"cache_read_input_tokens":0,"output_tokens":11,"service_tier":"standard"}}

The output is trimmed. POST /v1/messages/count_tokens does not exist and returns 404.

Model IDs

A model ID comes in two forms.

FormExampleWhat Meadow does
Plainclaude-haiku-5-5Picks the provider. The ID is one Meadow lists, a provider alias for one, or an ID of a family whose own provider you have a key for.
Pinnedanthropic/claude-haiku-5-5Sends the call to that provider only, with the part after the first slash as the model ID, as written.

Names written for other routers work as pinned IDs. Read from the server’s code and its tests, and not yet run on the hosted beta:

You sendMeadow reads it asWhere the spelling comes from
anthropic/claude-haiku-4.5anthropic/claude-haiku-4-5-20251001OpenRouter and Vercel AI Gateway IDs (author/slug, with a dot)
x-ai/grok-4.7xai/grok-4.7OpenRouter’s author name for xAI
gemini/gemini-3.8-flashgoogle/gemini-3.8-flashLiteLLM’s prefix for Google AI Studio
vertex_ai/gemini-3.8-flashvertex/google/gemini-3.8-flashLiteLLM’s prefix for Vertex
bedrock/claude-haiku-5-5bedrock/global.anthropic.claude-haiku-5-5, or the us. or eu. ID when the Bedrock provider key sets inference_profileA listed ID behind a prefix becomes that provider’s ID for it

The rule: after a prefix, an ID from GET /v1/models, or the OpenRouter name of a model behind its own provider, becomes the ID that provider uses, shown as provider_model_id in the list. The provider stays pinned, so there is no fallback to another provider. Text Meadow does not recognise is sent as written, as before. A key’s allowed_models is checked against the provider and ID the name resolves to, so a second spelling never reaches a model the key does not allow.

Meadow has no auto model that picks a model for you. With an OpenRouter key you can pin OpenRouter’s own router as openrouter/openrouter/auto. Not run on the hosted beta.

Either form may start with meadow/. Meadow drops that prefix and reads the rest as written, so meadow/claude-haiku-5-5 is the plain ID and meadow/anthropic/claude-haiku-5-5 is the pinned one. Use it with a tool that wants a <provider>/<model> name. The prefix also works in models, in a key’s allowed_models and in a project’s routing.models.per_model. Usage records keep requested_model as you sent it, and provider and model name the provider and the ID that served the call. Read from the server’s code and its tests. Not yet run on the hosted beta.

Plain IDs come from a fixed list inside Meadow (GET /v1/models). A plain ID that is not on it resolves in this order. Each step was run on the hosted beta.

  1. A provider’s documented alias routes like the model it names. claude-haiku-4-5 is Anthropic’s alias for claude-haiku-4-5-20251001, so it can be served by any provider that serves that model.
  2. An ID that starts with claude-, gpt- (also chatgpt-, o1, o3, o4), gemini- or grok- goes to that family’s own provider (anthropic, openai, google, xai) exactly as written, when you have a provider key for it. No other provider is tried for such an ID. If the provider does not know the ID you get the provider’s own 404.
  3. Anything else gets a 404 with error.code model_not_found, as OpenAI and Anthropic answer a model they do not serve, so their SDKs raise NotFoundError. The message names the ID and shows how to pin it. Seen on the hosted beta on 2026-11-28, on POST /v1/chat/completions:
{"error":{"message":"unknown model \"llama-typo-9\": it is not in GET /v1/models. Pin the provider that serves it by writing the model as \"<provider>/<that provider's model id>\", for example \"openrouter/<the id OpenRouter lists>\". An unlisted claude-, gpt-, gemini- or grok- id is passed through without a pin only when the project has a provider key for its own vendor (anthropic, openai, google, xai).","type":"invalid_request_error","param":"model","code":"model_not_found"},"request_id":"req_0000b95b"}

When the ID is close to IDs your key can call in that format, the message names up to three of them after the first sentence, nearest first: Close matches: "claude-haiku-4-5-20251001", "claude-haiku-5-5". The list never holds a model outside the key’s allowed_models, one that no stored provider key serves, or one a locked project excludes. Read from the server’s code and its tests. Not yet run on the hosted beta.

On POST /v1/messages the same 404 comes in Anthropic’s envelope, with "type":"not_found_error", error.details.error_code model_not_found and param model (seen on the hosted beta on 2026-11-28). Before 2026-11-28 both routes answered 400 with parameter_invalid.

That account had no OpenAI key. \u003c and \u003e are the JSON escapes for < and >: a JSON parser returns <provider>/<that provider's model id>. On the same account, which had an Anthropic key, claude-typo-9 went to Anthropic and came back as Anthropic’s own 404: {"type":"error","error":{"type":"not_found_error","message":"model: claude-typo-9"},...}.

Do: pin the provider when you want a model through a provider other than its own, for example openrouter/anthropic/claude-opus-4.5 or bedrock/<profile id>. Meadow passes a pinned ID through without checking it.

On a key with allowed_models, an unlisted ID is served only when the list names that plain ID or pins it to the same provider. OpenRouter differs here: its IDs are always author/slug, it resolves aliases to a canonical slug, and its model lookup returns 404 for an ID that is neither.

The prefix must be one of anthropic, openai, google, xai, openrouter, azure, bedrock, vertex, fireworks, or deepseek, or one of the three other spellings gemini, vertex_ai and x-ai. Anything else gets a 400 unknown model provider prefix. An OpenRouter ID keeps its own slash: openrouter/z-ai/glm-5.3. A Fireworks ID keeps its slashes too: fireworks/accounts/fireworks/models/kimi-k3.

Fireworks and DeepSeek serve only pinned IDs. None of their models is in GET /v1/models, and an unlisted plain ID such as deepseek-flash gets the 404 above. Write deepseek/deepseek-flash or fireworks/accounts/fireworks/models/<model>, with the ID from the provider’s own model page.

List the models your key can reach

curl -sS "$MEADOW_BASE_URL/v1/models" -H "Authorization: Bearer $MEADOW_API_KEY"
{"data":[
{"created":0,"id":"claude-haiku-5-5","object":"model","owned_by":"anthropic","providers":[
{"formats":["messages"],"provider":"anthropic","provider_model_id":"claude-haiku-5-5"},
{"formats":["chat_completions","responses","messages"],"provider":"openrouter","provider_model_id":"anthropic/claude-haiku-5.5"}]},
{"created":0,"id":"gemini-3.1-flash-lite-preview","object":"model","owned_by":"google","providers":[
{"formats":["chat_completions","generate_content"],"provider":"google","provider_model_id":"gemini-3.1-flash-lite-preview"},
{"formats":["chat_completions","responses","messages"],"provider":"openrouter","provider_model_id":"google/gemini-3.1-flash-lite-preview"}]}
],"has_more":false,"object":"list"}

The output is trimmed to two of 39 models. Each entry lists the providers that can serve the model with the provider keys you stored, in the order Meadow tries them by default, and the formats each accepts.

With the mdw CLI. mdw is sent to you during the beta. See Clients.

mdw models list
MODEL PROVIDER PROVIDER MODEL FORMATS
claude-fable-5-2 anthropic claude-fable-5-2 messages
claude-fable-5-2 openrouter anthropic/claude-fable-5.2 chat_completions,responses,messages
claude-haiku-4-5-20251001 anthropic claude-haiku-4-5-20251001 messages

Three things to know about the list:

  • It shows only models you have a usable provider key for. With no provider keys it is empty.
  • A key with allowed_models sees only those models. A locked project hides providers its routing excludes.
  • It does not ask the provider. A listed model can still fail when your provider account does not allow it. In our test account, OpenRouter rejected most listed models with a 404 because of a setting on that OpenRouter account.

The list has OpenAI’s shape: object is list, and each entry has object, created (always 0) and owned_by, next to Meadow’s own providers. The OpenAI SDK’s client.models.list() reads it. GET /v1/models/{id} does not exist and returns 404.

Pin a provider

Two ways, with the same effect:

curl -sS -D - -o /dev/null "$MEADOW_BASE_URL/v1/chat/completions" \
-H "Authorization: Bearer $MEADOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "google/gemini-3.1-flash-lite-preview", "messages": [{"role": "user", "content": "Say hello in five words."}], "max_tokens": 32}' \
| grep -i x-meadow
x-meadow-attempts: 1
x-meadow-model: gemini-3.1-flash-lite-preview
x-meadow-provider: google

Or keep the plain ID and send "provider": {"only": ["google"]}. Routing and fallbacks covers provider in full.

A pinned call has no other provider to fall back to. If you pin a provider you have no provider key for, you get a 422:

{"error":{"message":"no stored provider key can serve this request","type":"invalid_request_error","param":null,"code":"no_provider_key"},"request_id":"req_00002ee3"}

What passes through unchanged

Meadow reads four fields of the request body: model, models, provider, and stream. Before it forwards the request it removes models and provider and replaces model with the provider’s own ID. Every other field goes to the provider with its value untouched, including fields Meadow has never heard of. The order of top-level fields can change.

PartWhat happens
Request bodyForwarded as described above. Message content is never changed.
anthropic-version, anthropic-beta headersForwarded. A Messages call without anthropic-version gets 2023-06-01.
Other request headersNot forwarded. This includes OpenAI-Organization, OpenAI-Beta, and OpenRouter’s HTTP-Referer and X-Title.
Query stringForwarded to Anthropic, OpenAI, xAI, OpenRouter, and Azure. Dropped for Google, Bedrock, Vertex, Fireworks, and DeepSeek.
Response bodyReturned as the provider wrote it. Streams are relayed as they arrive.
Response headersOnly the provider’s retry-after, retry-after-ms, x-ratelimit-*, and anthropic-ratelimit-*, and on a served call the tier header of the provider that served it (x-gemini-service-tier from Google, x-amzn-bedrock-service-tier from Bedrock), are returned as sent. The provider’s request ID is returned under another name, x-meadow-provider-request-id, so that it cannot replace Meadow’s x-request-id.

Four exceptions to “untouched”:

  • Meadow owns the names provider and models. OpenRouter has its own request fields with those names, and you cannot send them through Meadow. A field Meadow does not know inside provider gets a 400 unknown field in provider routing.
  • Meadow sets stream_options.include_usage to true on every streamed Chat Completions call and removes the usage-only chunk unless you asked for it. See Usage and cost.
  • On a key with allowed_models, Meadow removes preset and route from requests sent to OpenRouter.
  • For Azure, Bedrock, and Vertex, Meadow rewrites the URL, the authentication, and the envelope fields the host requires.

The model field in the response is the provider’s ID, which can differ from what you sent. A call to openrouter/z-ai/glm-5.3 answers with "model":"z-ai/glm-5.3".

Meadow checks the request before any provider sees it. These get a 400 from Meadow: a body that is not one JSON object, a duplicate field, a missing model, a missing messages or input, a missing max_tokens on Messages, a stream that is not a boolean, and a Content-Type other than application/json.

Response headers

HeaderOnMeaning
x-request-idEvery responseMeadow’s ID for the request. Quote it to support. See Errors.
x-meadow-provider-request-idServed calls and provider errors passed through, when the provider sent oneThe answering provider’s own request ID, for that provider’s support. Providers tried before a fallback are not listed.
x-meadow-providerServed calls and provider errors passed throughThe provider that answered.
x-meadow-modelSameThe provider’s own ID for the model.
x-meadow-attemptsSameProviders tried, including the one that answered.
x-meadow-routeSameWhy this provider answered, in stable codes: direct: xai, or fallback: openai quota_exceeded -> openrouter. New on 2026-11-24, on the hosted beta since 2026-11-27.
x-meadow-provider-auth-failedAny model responseProviders that rejected your stored key during this request. Replace that provider key.
x-meadow-abandoned-attemptsAny model responseProviders that received the request and may bill for it, though their answer was not used.
retry-afterEvery 429Seconds to wait. See Token and request limits.
x-should-retrySome errorstrue on the 429s for a full server, a full body budget and a busy limit check: no provider was called. false on a 5xx on a model route, because a provider may have received the call. The official OpenAI and Anthropic SDKs obey it.
request-idEvery /v1/messages responseThe same value as x-request-id, in the header the Anthropic SDK reads.
x-gemini-service-tierServed calls answered by google, when Google sent itThe service tier Google served, as Google wrote it: standard, priority or flex. standard after a priority request means Google downgraded it and bills it at standard.
x-amzn-bedrock-service-tierServed calls answered by bedrock, when Bedrock sent itThe service tier Bedrock served, as Bedrock wrote it: default, priority, flex or reserved.
Provider rate-limit headersServed calls and errorsThe provider’s own values, for the provider key you stored.

An Anthropic call returns its rate-limit headers like this:

anthropic-ratelimit-requests-limit: 45000
anthropic-ratelimit-requests-remaining: 44999
anthropic-ratelimit-requests-reset: 2026-11-24T20:41:01Z
x-meadow-attempts: 1
x-meadow-model: claude-haiku-5-5
x-meadow-provider: anthropic
x-meadow-provider-request-id: req_00000a58...
x-request-id: req_0000ba32

When a call fails

Read the status, then check for x-meadow-provider.

  • The header is present on a 4xx: the provider rejected your request, and the body is in that provider’s shape. Google sends a JSON array, xAI sends {"code": ..., "error": "..."}, and Anthropic sends {"type": "error", ...}. Fix the request.
  • The header is absent: the body is Meadow’s, in the route’s own format (OpenAI’s envelope, or Anthropic’s on /v1/messages), with error.type, error.code and error.message. A 502 lists every provider tried in error.attempts.

Errors has the full list, and Routing and fallbacks shows each case.

API reference

Operations on this page: createChatCompletion, createResponse, createMessage, listModels.