> For the list of every page, fetch /llms.txt. The API contract is the OpenAPI file linked from the API reference.

# Create a message (Anthropic Messages format)

POST https%3A%2F%2Fapi.usemeadow.ai/v1/messages
Content-Type: application/json

Use this when your client speaks Anthropic Messages. Set the client's base URL to
`MEADOW_BASE_URL` and its API key to a Meadow key. Meadow accepts the key in
`x-api-key`, which is where Anthropic clients send it. The Anthropic Python SDK
was checked this way against the hosted service, blocking and streamed. Claude
Code uses the same route and has not been checked end to end.

```python
import os
from anthropic import Anthropic

client = Anthropic(base_url=os.environ["MEADOW_BASE_URL"], api_key=os.environ["MEADOW_API_KEY"])
reply = client.messages.create(
    model="claude-haiku-4-5-20251001",
    max_tokens=16,
    messages=[{"role": "user", "content": "Reply with the single word: meadow"}],
)
print(reply.content[0].text)
```

The body is the Anthropic Messages request. Meadow reads `model`, `models`,
`provider` and `stream`, removes `models` and `provider`, and passes everything
else to the vendor. `max_tokens` is required and must be at least 1, on every
key. `anthropic-version` and `anthropic-beta` request headers are forwarded.
When you send no `anthropic-version`, Meadow sends a default one. A query string
such as `?beta=true` is accepted. The rules for routing, fallback, limits,
headers and streaming are in the Models section above.

`POST /v1/messages/count_tokens` does not exist.

Scope: `models`.

```bash
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-4-5-20251001","max_tokens":16,
       "messages":[{"role":"user","content":"Reply with the single word: meadow"}]}'
```

**Streaming.** With `stream: true` the response is `text/event-stream` with
Anthropic's named events, in this order: `message_start`, then for each content
block `content_block_start`, one or more `content_block_delta`, and
`content_block_stop`, then `message_delta` with the stop reason and final usage,
then `message_stop`. `ping` events can appear anywhere. A captured stream, with
the usage objects shortened:

```text
event: message_start
data: {"type":"message_start","message":{"model":"claude-haiku-4-5-20251001","id":"msg_0000066e8","type":"message","role":"assistant","content":[],"stop_reason":null,"stop_sequence":null,"usage":{"input_tokens":15,"output_tokens":1}}}

event: content_block_start
data: {"type":"content_block_start","index":0,"content_block":{"type":"text","text":""}}

event: ping
data: {"type": "ping"}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"mead"}}

event: content_block_delta
data: {"type":"content_block_delta","index":0,"delta":{"type":"text_delta","text":"ow"}}

event: content_block_stop
data: {"type":"content_block_stop","index":0}

event: message_delta
data: {"type":"message_delta","delta":{"stop_reason":"end_turn","stop_sequence":null},"usage":{"input_tokens":15,"output_tokens":5}}

event: message_stop
data: {"type":"message_stop"}
```

Reference: https://docs.usemeadow.ai/api-endpoints/models/create-message

## Authentication

- `Authorization` header (bearer token, required) — A Meadow API key, sent as `Authorization: Bearer mdw_...`. The header `x-api-key: mdw_...` is accepted in its place.

## Request

### Body (application/json)

This endpoint expects a MessagesRequest.

- `model` (string, required) — A plain or prefixed model id. Same rules as Chat Completions.
- `messages` (list of map from string to any, required) — The conversation, in the Anthropic format. Required. Each entry must be an object. Passed through unchanged.
- `max_tokens` (integer, required) — The most tokens the model may write. Required, at least 1. Passed through, and used as the output cap for a key with a token limit.
- `models` (list of string, optional) — Fallback models, at most 3. Same rules as Chat Completions.
- `provider` (ModelRouting, optional) — Which model providers may serve a request, and in what order. Send it as `provider` on a model request, or store it on a project as `routing.models`. The field names follow OpenRouter's `provider` object. A field set on the request replaces the same field from the project. Fields the request leaves out keep the project's value. Every entry must be a model provider. An unknown field returns 400.
- `stream` (boolean, optional, default: false) — When true, the response is a server-sent event stream.

## Response

### 200

The vendor's Messages response, or its event stream when `stream` is true. Anthropic's `anthropic-ratelimit-*` headers are returned as sent.

- `map from string to any`

## Errors

### 400 Bad Request Error

Either Meadow refused the request, or the vendor did. A Meadow 400 is in the format's own envelope (`ModelRouteError`). A vendor 400 has the vendor's own body and carries `x-meadow-provider`. Fix the request before you send it again.

- `any`

### 401 Unauthorized Error

The key is missing, malformed, unknown, revoked, or expired, or a key it was minted from no longer exists. Check the key and the header. The body is in the format's own envelope, and `error.code` says which case it is.

- `ModelRouteError`
  - OpenAIError: OpenAIError
  - AnthropicError: AnthropicError

### 402 Payment Required Error

A dollar `limit` stops the call: the key, or a key above it, has spent its `limit`, or the estimate this call reserves would pass it. No vendor was called and nothing was charged. There is no `retry-after` header, because the wait is until the limit resets or is raised. Do not retry: raise the `limit` with `PATCH /v1/keys/{key_id}`, wait for `limit_reset_at`, or lower the request's output cap. The body is in the format's own envelope: the type is `insufficient_quota` on an OpenAI-format route and `billing_error` on `/v1/messages`. The same 402 with `error.code` `budget_exceeded` means a budget with `hard_limit` on the project or on the account has reached its `limit_usd`, or this call's estimate does not fit what is left of it. Raise `limit_usd`, switch `hard_limit` off, or wait for the budget's `resets_at`.

- `ModelRouteError`
  - OpenAIError: OpenAIError
  - AnthropicError: AnthropicError

### 403 Forbidden Error

The key may not make this call: it lacks the `models` scope, the model is not in its `allowed_models` or those of a key above it (`key_model_access_denied`), no provider in the route is in its `allowed_providers` (`key_provider_access_denied`), a request or token limit is used up, a dollar `limit` applies and the route includes a provider with no price (`key_spend_price_unknown`), or the project is locked and the request tried to override its routing.

- `ModelRouteError`
  - OpenAIError: OpenAIError
  - AnthropicError: AnthropicError

### 404 Not Found Error

The model id was not found, by Meadow or by the vendor. - Meadow cannot resolve a plain model id: it is not in `GET /v1/models`, and it is not an id of the `claude-`, `gpt-`, `gemini-` or `grok-` family on a project with that vendor's key. The body is in the format's own envelope (`ModelRouteError`) with `error.code` `model_not_found` and `error.param` `model`. The message names the id, lists up to three close ids the key can call, and shows how to pin a provider. No vendor was called. Earlier builds returned 400 with `error.code` `parameter_invalid`. - The vendor does not know the model id: a pinned id, or a plain id on a route with only one vendor (earlier builds: a 502). The body is the vendor's own and does not follow the `Error` schema. The response carries `x-meadow-provider`. Check the part of the model id after the provider prefix, or whether that vendor still serves the model.

- `any`

### 413 Content Too Large Error

The request body is larger than the 16 MiB the model routes allow. The body is in the format's own envelope.

- `ModelRouteError`
  - OpenAIError: OpenAIError
  - AnthropicError: AnthropicError

### 422 Unprocessable Entity Error

No stored provider key can serve this model in this format. Store a key for a provider that `GET /v1/models` would list for it, check that key's `project_ids`, or loosen `provider.only` and `provider.ignore`. The body is in the format's own envelope, with `error.code` `no_provider_key`.

- `ModelRouteError`
  - OpenAIError: OpenAIError
  - AnthropicError: AnthropicError

### 429 Too Many Requests Error

Too many requests. Either the server instance was full and no slot came free for the account within 3 seconds (`account_in_flight_limit_exceeded`), or the key's limit check waited too long (`key_limit_check_busy`), or the last vendor tried was rate limited, or too many failed authentications came from your address. Wait for `retry-after` seconds, then retry with backoff. The body is in the format's own envelope.

- `ModelRouteError`
  - OpenAIError: OpenAIError
  - AnthropicError: AnthropicError

### 500 Internal Server Error

Meadow failed. Do not resend a model call blindly: a vendor may have received it. Tell us if it persists. The body is in the format's own envelope.

- `ModelRouteError`
  - OpenAIError: OpenAIError
  - AnthropicError: AnthropicError

### 502 Bad Gateway Error

No vendor served the request. `attempts` lists each vendor tried and how it failed. `all_providers_failed` means the whole route was tried. `provider_error` means fallbacks were off (`allow_fallbacks: false`) and the one vendor failed, or a limited key ran out of time. A 404 from the only vendor in the route is not a 502: the vendor's 404 comes back as written. Retry with backoff. Read `x-meadow-provider-auth-failed` to find a stored key a vendor rejected, and `x-meadow-abandoned-attempts` for vendors that may bill for the call anyway. The body is in the format's own envelope: `error.type` is `server_error` or `api_error`, and `error.code` keeps `all_providers_failed` or `provider_error`.

- `ModelRouteError`
  - OpenAIError: OpenAIError
  - AnthropicError: AnthropicError

## Types

### ModelRouting

Which model providers may serve a request, and in what order. Send it as `provider` on a model request, or store it on a project as `routing.models`. The field names follow OpenRouter's `provider` object. A field set on the request replaces the same field from the project. Fields the request leaves out keep the project's value. Every entry must be a model provider. An unknown field returns 400.

- `order` (list of enum, optional) — Providers to try first, in this order. Providers not named are still tried afterwards, in the default order. When neither the request nor the project sets it, Meadow uses the model's own vendor, then hosts (`azure`, `bedrock`, `vertex`, `fireworks`), then `openrouter`. Providers the account has no key for are skipped.
  - Allowed values: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`, `daytona`, `modal`
- `only` (list of enum, optional) — Use only these providers. Others are never tried.
  - Allowed values: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`, `daytona`, `modal`
- `ignore` (list of enum, optional) — Never use these providers.
  - Allowed values: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`, `daytona`, `modal`
- `allow_fallbacks` (boolean, optional, default: true) — When false, only the first provider is tried, and the ids in `models` are not tried.

### OpenAIError

An error in OpenAI's envelope, `{"error": {"message", "type", "param", "code"}}`. The OpenAI SDKs pick the error class from the HTTP status and expose these four fields. `attempts` and `request_id` are Meadow's additions.

- `error` (OpenAiErrorError, required)
- `request_id` (string, optional) — The same id as the `x-request-id` response header. The OpenAI SDKs read the header.

### AnthropicError

An error in Anthropic's envelope, `{"type": "error", "error": {"type", "message"}, "request_id"}`. The Anthropic SDKs pick the error class from the HTTP status and expose `error.type` as `type` and `error.details.error_code` as `error_code`. `code`, `param` and `attempts` inside `error` are Meadow's additions.

- `type` (enum, required)
  - Allowed values: `error`
- `request_id` (string, required, nullable) — The same id as the `request-id` and `x-request-id` response headers.
- `error` (AnthropicErrorError, required)

### OpenAiErrorError

- `message` (string, required) — A sentence for people. It can change, so do not match on it.
- `type` (enum, required) — OpenAI's class for the failure: `invalid_request_error` for a 400, 401, 403, 404, 405, 409, 413 or 422, `insufficient_quota` for a 402, `rate_limit_error` for a 429, `server_error` for a 500, 501 or 502, and `service_unavailable_error` for a 503.
  - Allowed values: `invalid_request_error`, `insufficient_quota`, `rate_limit_error`, `server_error`, `service_unavailable_error`
- `param` (string, required, nullable) — The request field or header at fault, or null. Set on most validation errors.
- `code` (string, required, nullable) — Meadow's stable code for the specific failure, the same value as `error.code` on every other route. The Errors guide lists them.
- `attempts` (list of Attempt, optional) — The vendors Meadow tried for this request, in order. Present only when it tried at least one.

### AnthropicErrorError

- `type` (enum, required) — Anthropic's class for the failure: `invalid_request_error` (400, 405, 422), `authentication_error` (401), `billing_error` (402), `permission_error` (403), `not_found_error` (404), `conflict_error` (409), `request_too_large` (413), `rate_limit_error` (429) and `api_error` (500, 501, 502, 503).
  - Allowed values: `invalid_request_error`, `authentication_error`, `billing_error`, `permission_error`, `not_found_error`, `conflict_error`, `request_too_large`, `rate_limit_error`, `api_error`
- `message` (string, required) — A sentence for people. It can change, so do not match on it.
- `details` (AnthropicErrorErrorDetails, optional) — Where Anthropic's format carries an error code.
- `code` (string, optional) — Meadow's stable code for the specific failure, the same value as `error.code` on every other route. The Errors guide lists them.
- `param` (string, optional) — The request field or header at fault, when there is one.
- `attempts` (list of Attempt, optional) — The vendors Meadow tried for this request, in order. Present only when it tried at least one.

### Attempt

One try at one vendor, for a model call or a sandbox create.

- `provider` (enum, required) — The name of a vendor. Model providers and sandbox providers share one list. Model providers: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`. Sandbox providers: `daytona`, `modal`.
  - Allowed values: `anthropic`, `openai`, `google`, `xai`, `azure`, `bedrock`, `vertex`, `openrouter`, `fireworks`, `deepseek`, `daytona`, `modal`
- `outcome` (enum, required) — How the try ended. - `served`: this vendor served the request. - `unsupported`: the vendor cannot do what was asked, such as a resource size, a network rule, or a model it does not offer. - `refused`: the vendor rejected the request or the stored credential. - `no_capacity`: the vendor had no capacity. - `timeout`: the vendor did not answer in time. - `rate_limited`: the vendor answered 429. - `error`: any other failure.
  - Allowed values: `served`, `unsupported`, `refused`, `no_capacity`, `timeout`, `rate_limited`, `error`
- `reason` (enum, optional) — A stable code for why the try ended as it did. It is narrower than `outcome`, and it is the code to branch on or to count. More values can be added: treat one you do not know like `vendor_error`. - `served`: this vendor served the request. - `no_capacity`: the vendor had no capacity. - `quota_exceeded`: the vendor account is out of quota or credit. - `rate_limited`: the vendor answered 429. - `timeout`: the vendor did not answer in time. - `auth_failed`: the vendor rejected the stored vendor key. - `invalid_request`: the vendor rejected the request itself. - `refused`: the vendor refused for another reason. - `unsupported`: the vendor cannot do what was asked, such as a model, a GPU type, a size or a network rule. - `no_provider_key`: skipped, because no usable vendor key was stored. - `image_pull_failed`, `build_failed`: the vendor could not pull or build the image (sandboxes). - `provider_lost`: the vendor lost the sandbox while it was starting. - `vendor_error`: any other failure.
  - Allowed values: `served`, `no_capacity`, `quota_exceeded`, `rate_limited`, `timeout`, `auth_failed`, `invalid_request`, `refused`, `unsupported`, `no_provider_key`, `image_pull_failed`, `build_failed`, `provider_lost`, `vendor_error`
- `started_at` (datetime, optional) — When Meadow started this try. Absent on attempts recorded before 2026-11-24.
- `finished_at` (datetime, optional) — When this try ended.
- `detail` (string, optional) — A short description of what happened, written by Meadow, such as `provider returned HTTP 404`. On a `served` sandbox attempt it reports resources the vendor granted that differ from the request, such as `provider granted cpu 2 instead of 1.5` or `gpu type H200 instead of H100`. It says `provider built a copy of the image for this size` when this create made a new Daytona snapshot for an `image_id`. On an `unsupported` attempt it carries the vendor's size limit, such as `daytona cannot serve this size: CPU request 8 exceeds maximum allowed per sandbox (4)`. Absent when there is nothing to say.
- `duration_ms` (integer, optional) — How long the try took, in milliseconds.

### AnthropicErrorErrorDetails

Where Anthropic's format carries an error code.

- `error_code` (string, optional) — The same value as `code`. The Anthropic SDKs expose it as `error_code`.

## Examples

### Served by Anthropic (usage shortened)

**Response**

```json
{
  "content": [
    {
      "text": "meadow",
      "type": "text"
    }
  ],
  "id": "msg_00004ce4",
  "model": "claude-haiku-4-5-20251001",
  "role": "assistant",
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "type": "message",
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "input_tokens": 15,
    "output_tokens": 5,
    "service_tier": "standard"
  }
}
```

**SDK Code**

```python Served by Anthropic (usage shortened)
import requests

url = "https://api.example.com/v1/messages"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Served by Anthropic (usage shortened)
const url = 'https://api.example.com/v1/messages';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Served by Anthropic (usage shortened)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/messages"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Served by Anthropic (usage shortened)
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Served by Anthropic (usage shortened)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/v1/messages")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Served by Anthropic (usage shortened)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/messages', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Served by Anthropic (usage shortened)
using RestSharp;

var client = new RestClient("https://api.example.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Served by Anthropic (usage shortened)
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/messages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Let Meadow pick the vendor

**Request**

```json
{
  "model": "claude-haiku-4-5-20251001",
  "messages": [
    {
      "content": "Reply with the single word: meadow",
      "role": "user"
    }
  ],
  "max_tokens": 16
}
```

**Response**

```json
{
  "content": [
    {
      "text": "meadow",
      "type": "text"
    }
  ],
  "id": "msg_00004ce4",
  "model": "claude-haiku-4-5-20251001",
  "role": "assistant",
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "type": "message",
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "input_tokens": 15,
    "output_tokens": 5,
    "service_tier": "standard"
  }
}
```

**SDK Code**

```python Let Meadow pick the vendor
import requests

url = "https://api.example.com/v1/messages"

payload = {
    "model": "claude-haiku-4-5-20251001",
    "messages": [
        {
            "content": "Reply with the single word: meadow",
            "role": "user"
        }
    ],
    "max_tokens": 16
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Let Meadow pick the vendor
const url = 'https://api.example.com/v1/messages';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"claude-haiku-4-5-20251001","messages":[{"content":"Reply with the single word: meadow","role":"user"}],"max_tokens":16}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Let Meadow pick the vendor
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/messages"

	payload := strings.NewReader("{\n  \"model\": \"claude-haiku-4-5-20251001\",\n  \"messages\": [\n    {\n      \"content\": \"Reply with the single word: meadow\",\n      \"role\": \"user\"\n    }\n  ],\n  \"max_tokens\": 16\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Let Meadow pick the vendor
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"claude-haiku-4-5-20251001\",\n  \"messages\": [\n    {\n      \"content\": \"Reply with the single word: meadow\",\n      \"role\": \"user\"\n    }\n  ],\n  \"max_tokens\": 16\n}"

response = http.request(request)
puts response.read_body
```

```java Let Meadow pick the vendor
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/v1/messages")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"claude-haiku-4-5-20251001\",\n  \"messages\": [\n    {\n      \"content\": \"Reply with the single word: meadow\",\n      \"role\": \"user\"\n    }\n  ],\n  \"max_tokens\": 16\n}")
  .asString();
```

```php Let Meadow pick the vendor
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/messages', [
  'body' => '{
  "model": "claude-haiku-4-5-20251001",
  "messages": [
    {
      "content": "Reply with the single word: meadow",
      "role": "user"
    }
  ],
  "max_tokens": 16
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Let Meadow pick the vendor
using RestSharp;

var client = new RestClient("https://api.example.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"claude-haiku-4-5-20251001\",\n  \"messages\": [\n    {\n      \"content\": \"Reply with the single word: meadow\",\n      \"role\": \"user\"\n    }\n  ],\n  \"max_tokens\": 16\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Let Meadow pick the vendor
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "claude-haiku-4-5-20251001",
  "messages": [
    [
      "content": "Reply with the single word: meadow",
      "role": "user"
    ]
  ],
  "max_tokens": 16
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/messages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Pin the vendor with a prefixed model id

**Request**

```json
{
  "model": "anthropic/claude-haiku-4-5-20251001",
  "messages": [
    {
      "content": "Reply with the single word: meadow",
      "role": "user"
    }
  ],
  "max_tokens": 16
}
```

**Response**

```json
{
  "content": [
    {
      "text": "meadow",
      "type": "text"
    }
  ],
  "id": "msg_00004ce4",
  "model": "claude-haiku-4-5-20251001",
  "role": "assistant",
  "stop_reason": "end_turn",
  "stop_sequence": null,
  "type": "message",
  "usage": {
    "cache_creation_input_tokens": 0,
    "cache_read_input_tokens": 0,
    "input_tokens": 15,
    "output_tokens": 5,
    "service_tier": "standard"
  }
}
```

**SDK Code**

```python Pin the vendor with a prefixed model id
import requests

url = "https://api.example.com/v1/messages"

payload = {
    "model": "anthropic/claude-haiku-4-5-20251001",
    "messages": [
        {
            "content": "Reply with the single word: meadow",
            "role": "user"
        }
    ],
    "max_tokens": 16
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Pin the vendor with a prefixed model id
const url = 'https://api.example.com/v1/messages';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"anthropic/claude-haiku-4-5-20251001","messages":[{"content":"Reply with the single word: meadow","role":"user"}],"max_tokens":16}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Pin the vendor with a prefixed model id
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.example.com/v1/messages"

	payload := strings.NewReader("{\n  \"model\": \"anthropic/claude-haiku-4-5-20251001\",\n  \"messages\": [\n    {\n      \"content\": \"Reply with the single word: meadow\",\n      \"role\": \"user\"\n    }\n  ],\n  \"max_tokens\": 16\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Pin the vendor with a prefixed model id
require 'uri'
require 'net/http'

url = URI("https://api.example.com/v1/messages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"anthropic/claude-haiku-4-5-20251001\",\n  \"messages\": [\n    {\n      \"content\": \"Reply with the single word: meadow\",\n      \"role\": \"user\"\n    }\n  ],\n  \"max_tokens\": 16\n}"

response = http.request(request)
puts response.read_body
```

```java Pin the vendor with a prefixed model id
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.example.com/v1/messages")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"anthropic/claude-haiku-4-5-20251001\",\n  \"messages\": [\n    {\n      \"content\": \"Reply with the single word: meadow\",\n      \"role\": \"user\"\n    }\n  ],\n  \"max_tokens\": 16\n}")
  .asString();
```

```php Pin the vendor with a prefixed model id
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.example.com/v1/messages', [
  'body' => '{
  "model": "anthropic/claude-haiku-4-5-20251001",
  "messages": [
    {
      "content": "Reply with the single word: meadow",
      "role": "user"
    }
  ],
  "max_tokens": 16
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Pin the vendor with a prefixed model id
using RestSharp;

var client = new RestClient("https://api.example.com/v1/messages");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"anthropic/claude-haiku-4-5-20251001\",\n  \"messages\": [\n    {\n      \"content\": \"Reply with the single word: meadow\",\n      \"role\": \"user\"\n    }\n  ],\n  \"max_tokens\": 16\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Pin the vendor with a prefixed model id
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "anthropic/claude-haiku-4-5-20251001",
  "messages": [
    [
      "content": "Reply with the single word: meadow",
      "role": "user"
    ]
  ],
  "max_tokens": 16
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/messages")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```