# One model's providers

`GET /v1/models/{lab}/{model}/endpoints` lists the providers serving one model, each with its
prices in DA, its limits and how it has been running.

## Request

Send it with an API key. The two fields go in the address: the model's ID, `lab/model`, split at
its slash. The [Models](/docs/models) guide says where to copy it.

| Field | Needed | You send |
|---|---|---|
| `lab` | yes | the lab's part of the model's ID: `anthropic` in `anthropic/claude-sonnet-4.5` |
| `model` | yes | the model's part: `claude-sonnet-4.5` |

A picture model answers the same question in the picture routes' own terms at
`GET /v1/images/models/{lab}/{model}/endpoints`, below.

```python
import json
import os
import urllib.request

API_KEY = os.environ["OPENDUNES_API_KEY"]
MODEL = "anthropic/claude-sonnet-4.5"
ADDRESS = f"https://opendunes.com/v1/models/{MODEL}/endpoints"

request = urllib.request.Request(
    ADDRESS,
    headers={"Authorization": "Bearer " + API_KEY},
)
with urllib.request.urlopen(request) as response:
    model = json.load(response)["data"]

for endpoint in model["endpoints"]:
    print(
        endpoint["provider_name"],
        endpoint["context_length"],
        endpoint["pricing"]["prompt"],
    )
```

```javascript
const API_KEY = process.env.OPENDUNES_API_KEY;
const MODEL = "anthropic/claude-sonnet-4.5";
const ADDRESS = `https://opendunes.com/v1/models/${MODEL}/endpoints`;

const response = await fetch(ADDRESS, {
  headers: { Authorization: `Bearer ${API_KEY}` },
});
const { data } = await response.json();

for (const endpoint of data.endpoints) {
  const { provider_name, context_length, pricing } = endpoint;
  console.log(provider_name, context_length, pricing.prompt);
}
```

```go
package main

import (
	"encoding/json"
	"fmt"
	"net/http"
	"os"
)

const (
	model   = "anthropic/claude-sonnet-4.5"
	address = "https://opendunes.com/v1/models/" + model + "/endpoints"
)

func main() {
	apiKey := os.Getenv("OPENDUNES_API_KEY")

	req, err := http.NewRequest("GET", address, nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer "+apiKey)

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	var body struct {
		Data struct {
			Endpoints []struct {
				ProviderName  string         `json:"provider_name"`
				ContextLength int            `json:"context_length"`
				Pricing       map[string]any `json:"pricing"`
			} `json:"endpoints"`
		} `json:"data"`
	}
	if err := json.NewDecoder(res.Body).Decode(&body); err != nil {
		panic(err)
	}
	for _, endpoint := range body.Data.Endpoints {
		fmt.Println(
			endpoint.ProviderName,
			endpoint.ContextLength,
			endpoint.Pricing["prompt"],
		)
	}
}
```

```bash cURL
MODEL="anthropic/claude-sonnet-4.5"
ADDRESS="https://opendunes.com/v1/models/$MODEL/endpoints"

curl "$ADDRESS" \
  -H "Authorization: Bearer $OPENDUNES_API_KEY"
```

## Response

`200 OK`.

| Field | Holds |
|---|---|
| `data` | the model, and its providers |
| `id` · `name` · `created` · `description` · `architecture` | the model, as [One model](/docs/reference/model) answers it |
| `endpoints` | one entry per provider serving it |

Each entry in `endpoints` holds:

| Field | Holds |
|---|---|
| `name` | the provider and the model it serves there |
| `model_id` | the model's ID fixed to one release |
| `model_name` | the model's name on this provider's list |
| `provider_name` | the provider |
| `tag` | the provider's tag: send it in `provider.only` or `provider.order` to pick this entry |
| `context_length` | the most tokens a request and its answer hold together here |
| `max_completion_tokens` | the longest answer, in tokens, or `null` |
| `max_prompt_tokens` | the longest prompt, in tokens, or `null` |
| `pricing` | this provider's prices in DA, one per meter, each a string per unit of that meter: `prompt` and `completion` per token, `image` per picture sent, `request` per request, and the rest the model has. Beside them, `discount`, where this provider runs a promotion: `0.5` for half off, already inside those prices |
| `quantization` | the precision the model runs at here, such as `fp8`, or `unknown` |
| `supported_parameters` | the request fields this provider honours |
| `supports_tool_choice` | which `tool_choice` values it honours: `none`, `auto`, `required`, `function`, each `true` or `false` |
| `supports_implicit_caching` | `true` when it caches a repeated prompt without being asked |
| `status` | `0` when it is serving normally; below `0`, degraded or down |
| `uptime_last_5m` · `uptime_last_30m` · `uptime_last_1d` | the share of its requests that succeeded, in percent, or `null` |
| `latency_last_30m` | time to the first token, in milliseconds, at `p50`, `p75`, `p90` and `p99`, or `null` |
| `throughput_last_30m` | tokens per second, at the same four points, or `null` |
| `perf_last_30m_by_workload` | the same readings, split by the kind of request served, such as `text_generation` or `embeddings` |

**A picture model.** `GET /v1/images/models/{lab}/{model}/endpoints` answers `data` with the
model's `id` and its `endpoints`, and a 404 for a model that does not make pictures. Each entry
holds:

| Field | Holds |
|---|---|
| `provider_name` | the provider |
| `provider_slug` | the provider's short name |
| `provider_tag` | its tag, to pick this entry in `provider` |
| `supports_streaming` | `true` when it streams a picture as it is made |
| `supported_parameters` | the request fields it honours, each with its type and the values it takes |
| `allowed_passthrough_parameters` | the provider's own settings it accepts, under `provider` |
| `billable` | in each line of `pricing`: what is counted, such as `output_image` or `input_image` |
| `unit` | in each line: the unit it is counted in: `request`, `image`, `megapixel` or `token` |
| `variant` | in each line, where there is one: which kind of that output the line prices |
| `cost` | in each line: the price per unit, in DA, as a string |
| `discount` | in each line: the promotion already inside `cost`, `0.5` for half off, `0` when there is none |

## What it cost

Free. Reading the catalogue is never charged.

## Errors

`error.code` carries the status, and `error.message` says why.

| Status | When |
|---|---|
| 401 | the key is missing, wrong, disabled or expired |
| 403 | the key answers only from the addresses set on it, and this request came from another |
| 404 | the model is not on sale; on the picture route, or it does not make pictures |
| 503 | the providers could not be read just now; `Retry-After` says how many seconds to wait |
