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

# List the models this key can reach

GET https%3A%2F%2Fapi.usemeadow.ai/v1/models

Returns every model the calling key can use right now, and for each one the
vendors that can serve it and the formats each vendor accepts. Call it after you
store a provider key to check that routing sees it, and to pick a model id.

A model is listed only when the account has a stored key for at least one of its
vendors, that key is enabled for the calling key's project, and the
`allowed_models` of the calling key and of every key above it permit it. A vendor
the project's routing excludes, or one outside the `allowed_providers` of the
calling key or a key above it, is left out.
`azure` is listed for a model only when the stored `deployments` map names it.
With no usable provider key the list is empty.

The list is not paginated. It is Meadow's own catalog. A model that is missing
from it can still be called with a prefixed id such as `openrouter/<vendor id>`.

A plain id that is not in the catalog resolves in this order:

1. A vendor's documented alias for a listed model routes like that model.
   `claude-haiku-4-5` is Anthropic's alias for `claude-haiku-4-5-20251001`.
2. An id of the `claude-`, `gpt-` (also `chatgpt-`, `o1`, `o3`, `o4`), `gemini-`
   or `grok-` family goes to that family's own vendor (`anthropic`, `openai`,
   `google`, `xai`) as written, when the project has a provider key for it. No
   other provider is tried for such an id, and the vendor's own 404 comes back
   if the vendor does not know it. Project routing still applies.
3. Anything else returns 404 with `error.code` `model_not_found`, in the
   format's own envelope, as OpenAI and Anthropic answer a model they do not
   serve. The message names the id and shows how to pin it.

`allowed_models` stays exact: an unlisted id is served only when the list names
that plain id or pins it to that same vendor. An alias and the id it names
count as the same model.

The envelope and each item also carry OpenAI's list fields (`object`, `created`,
`owned_by`), so an OpenAI SDK's `models.list()` reads the response. Meadow keeps
no release dates, so `created` is always 0.

Scope: `models`.

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

## 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.

## Response

### 200

The models, sorted by id.

- `data` (list of Model, required) — One entry per model. Empty when no stored key can serve any model.
- `object` (enum, optional) — Always `list`, as on OpenAI.
  - Allowed values: `list`
- `has_more` (boolean, optional) — Always false. This list is not paged.

## Errors

### 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

### 403 Forbidden Error

The key does not have the `models` scope. Use a key that has it. The body is in OpenAI's envelope.

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

### 429 Too Many Requests Error

More than 20 failed authentications came from your address in one minute, and this request also failed to authenticate, or the account has too many requests open on one server instance (`error.code` `account_in_flight_limit_exceeded`). Wait for `retry-after` seconds, then retry. The body is in OpenAI's 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

## Types

### Model

A model the calling key can use, and who can serve it.

- `id` (string, required) — The id to send as `model`.
- `providers` (list of ModelProvidersItems, required) — Providers that can serve it with the account's stored keys, in the default order Meadow would try them.
- `object` (enum, optional) — Always `model`, as on OpenAI.
  - Allowed values: `model`
- `created` (integer, optional) — Present so that an OpenAI SDK's `models.list()` can read the item. Meadow keeps no release dates, so it is always 0. Do not sort or filter by it.
- `owned_by` (string, optional) — The model's own vendor, such as `anthropic`. For an id Meadow does not know, reached through a pinned id in `allowed_models`, it is the pinned provider.

### 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)

### ModelProvidersItems

- `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`
- `formats` (list of enum, required) — Formats this provider accepts for this model: `chat_completions` for `POST /v1/chat/completions`, `responses` for `POST /v1/responses`, `messages` for `POST /v1/messages`, `generate_content` for `POST /v1beta/models/{model}:generateContent` and `:streamGenerateContent`.
  - Allowed values: `chat_completions`, `responses`, `messages`, `generate_content`
- `provider_model_id` (string, optional) — The provider's own id for this model. It is what `x-meadow-model` reports.

### 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

**Response**

```json
{
  "data": [
    {
      "id": "gemini-3.1-flash-lite-preview",
      "providers": [
        {
          "provider": "google",
          "formats": [
            "chat_completions",
            "generate_content"
          ],
          "provider_model_id": "gemini-3.1-flash-lite-preview"
        },
        {
          "provider": "openrouter",
          "formats": [
            "chat_completions",
            "responses",
            "messages"
          ],
          "provider_model_id": "google/gemini-3.1-flash-lite-preview"
        }
      ],
      "object": "model",
      "created": 0,
      "owned_by": "google"
    }
  ],
  "object": "list",
  "has_more": false
}
```

**SDK Code**

```python A key whose allowed_models holds one model. The OpenAI list fields (object, has_more, created, owned_by) were added by hand and not captured live.
import requests

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

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

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

print(response.json())
```

```javascript A key whose allowed_models holds one model. The OpenAI list fields (object, has_more, created, owned_by) were added by hand and not captured live.
const url = 'https://api.example.com/v1/models';
const options = {method: 'GET', 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 A key whose allowed_models holds one model. The OpenAI list fields (object, has_more, created, owned_by) were added by hand and not captured live.
package main

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

func main() {

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

	req, _ := http.NewRequest("GET", 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 A key whose allowed_models holds one model. The OpenAI list fields (object, has_more, created, owned_by) were added by hand and not captured live.
require 'uri'
require 'net/http'

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

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

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

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

```java A key whose allowed_models holds one model. The OpenAI list fields (object, has_more, created, owned_by) were added by hand and not captured live.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php A key whose allowed_models holds one model. The OpenAI list fields (object, has_more, created, owned_by) were added by hand and not captured live.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp A key whose allowed_models holds one model. The OpenAI list fields (object, has_more, created, owned_by) were added by hand and not captured live.
using RestSharp;

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

```swift A key whose allowed_models holds one model. The OpenAI list fields (object, has_more, created, owned_by) were added by hand and not captured live.
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.example.com/v1/models")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
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()
```