> This page is for Gateway.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.merge.dev/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.merge.dev/_mcp/server.

# Get Model

GET https://api-gateway.merge.dev/v1/organization/models/{model_id}

Get one model by its `provider/model` id.

Needs `view_routing` or `manage_routing`.

Reference: https://docs.merge.dev/merge-gateway/management-api/lookups/get-model

## Authentication

- `Authorization` header (bearer token, required) — A management key (`mgmt_...`), sent as `Authorization: Bearer <key>`. Reading /v1/routing-policies also accepts the organization's gateway API keys; writing there needs a management key.

## Request

### Path parameters

- `model_id` (string, required) — The model's `provider/model` id.

## Response

### 200

The model

- `context_window` (integer, required) — Maximum input context, in tokens.
- `display_name` (string, required) — The model's name, like `Claude Sonnet 4.6`.
- `expiration_date` (date, required, nullable) — The day the model is retired. null when no date is set.
- `id` (string, required) — The canonical `provider/model` id.
- `input_cost_per_million` (double, required) — List price per million input tokens (USD).
- `input_modalities` (list of string, required) — What the model accepts, like `text`, `image`.
- `max_output_tokens` (integer, required) — Maximum output, in tokens.
- `output_cost_per_million` (double, required) — List price per million output tokens (USD).
- `output_modalities` (list of string, required) — What the model returns.
- `provider` (string, required) — The model's creator, like `openai`.
- `replacement_model` (string, required, nullable) — The model to move to once this one is retired.
- `status` (enum, required) — `deprecated` models are retired on `expiration_date`; move to `replacement_model`.
  - Allowed values: `available`, `beta`, `deprecated`

## Errors

### 401 Unauthorized Error

The key is missing or invalid.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 403 Forbidden Error

The key lacks the scope this route needs, or the change is not allowed.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 404 Not Found Error

The resource does not exist in the key's organization.

- `detail` (ErrorResponseDetail, required) — A message, or an object with a `code` to branch on and a `message`.

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### ErrorResponseDetail

A message, or an object with a `code` to branch on and a `message`.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)
- `ctx` (ValidationErrorCtx, optional)
- `input` (any, optional)

### ErrorDetail

A structured error. Some carry extra fields, like `count`.

- `code` (string, required) — A stable code to branch on, like `payment_method_required`.
- `message` (string, required) — A human-readable explanation.

### ValidationErrorLocItems

### ValidationErrorCtx

## Examples

**Response**

```json
{
  "context_window": 200000,
  "display_name": "Claude Sonnet 4.6",
  "expiration_date": null,
  "id": "anthropic/claude-sonnet-4-6",
  "input_cost_per_million": 3,
  "input_modalities": [
    "text",
    "image"
  ],
  "max_output_tokens": 64000,
  "output_cost_per_million": 15,
  "output_modalities": [
    "text"
  ],
  "provider": "anthropic",
  "replacement_model": null,
  "status": "available"
}
```

**SDK Code**

```python
import requests

url = "https://api-gateway.merge.dev/v1/organization/models/model_id"

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

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

print(response.json())
```

```javascript
const url = 'https://api-gateway.merge.dev/v1/organization/models/model_id';
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
package main

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

func main() {

	url := "https://api-gateway.merge.dev/v1/organization/models/model_id"

	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
require 'uri'
require 'net/http'

url = URI("https://api-gateway.merge.dev/v1/organization/models/model_id")

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
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-gateway.merge.dev/v1/organization/models/model_id")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-gateway.merge.dev/v1/organization/models/model_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-gateway.merge.dev/v1/organization/models/model_id");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api-gateway.merge.dev/v1/organization/models/model_id")! 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()
```