> 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/models/{model_id}

Get one catalog model by ID; an unknown ID returns 404 `model_not_found`.

Reference: https://docs.merge.dev/merge-gateway/api-overview/models/retrieve

## Authentication

- `Authorization` header (bearer token, required) — Your production key sent as a bearer token.

## Request

### Path parameters

- `model_id` (string, required) — Model ID as `provider/model-name`, for example `openai/gpt-5.4`.

## Response

### 200

Successful Response

- `model` (string, required) — Model ID in format 'provider/model-name'
- `provider` (string, required)
- `display_name` (string, required)
- `vendors` (map from string to PublicVendorModelInfo, required)
- `availability_status` (enum, required)
  - Allowed values: `available`, `deprecated`
- `created_at` (datetime, optional, nullable)
- `updated_at` (datetime, optional, nullable)
- `aliases` (list of PublicModelAlias, optional) — Aliases that resolve to this model.
- `access_required` (boolean, optional, default: false) — True when the model is listed but calls to it return 403 until access is granted.
- `access_reason` (string, optional, nullable) — Machine-readable reason access is required, matching the error `code` the model endpoints return; null otherwise.
- `source` (enum, optional) — Set to `self_hosted` on models served by an endpoint your organization registered; absent for catalog models.
  - Allowed values: `self_hosted`

## Errors

### 422 Unprocessable Entity Error

Validation Error

- `detail` (list of ValidationError, optional)

## Types

### PublicVendorModelInfo

Per-vendor execution metadata for a model, including context window, max output tokens, capabilities, pricing, and availability. A single `PublicModel` carries one of these for each vendor that can execute it.

- `context_window` (integer, required)
- `max_output_tokens` (integer, required)
- `availability_status` (enum, required)
  - Allowed values: `available`, `deprecated`
- `capabilities` (PublicVendorModelCapabilities, required) — Per-route capability flags. Lists supported input/output content types (text, image, document, tool_use) and feature support (tool calling, tool choice, structured outputs, streaming).
- `pricing` (ModelPricing, required) — Pricing information for a model.
- `launch_date` (string, optional, nullable)
- `service_tiers` (list of string, optional, default: ["standard"]) — Service tiers this route supports (always includes 'standard'). Presence of 'flex' means the route is priced for flex.
- `zero_data_retention` (boolean, optional, default: false) — Whether this vendor route supports zero data retention.
- `batch_endpoints` (list of string, optional, nullable) — Batch `endpoint` values this route runs, set only on batch-capable routes.

### PublicModelAlias

An alias that resolves to this model.

- `model` (string, required) — Alias model ID.
- `type` (string, required) — Alias type.
- `display_name` (string, optional, nullable)
- `description` (string, optional, nullable)

### ValidationError

Single field-level validation error. `loc` is the JSON path to the offending field, `msg` is a human-readable explanation, and `type` is a stable machine-readable error code.

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

### PublicVendorModelCapabilities

Per-route capability flags. Lists supported input/output content types (text, image, document, tool_use) and feature support (tool calling, tool choice, structured outputs, streaming).

- `input` (list of enum, required)
  - Allowed values: `text`, `image`, `document`, `audio`, `video`, `embedding`
- `output` (list of enum, required)
  - Allowed values: `text`, `tool_use`, `embedding`, `image`, `audio`, `video`, `decision`
- `supports_tool_calling` (boolean, required)
- `supports_structured_outputs` (boolean, required)
- `streaming` (boolean, required)
- `supports_tool_choice` (boolean, optional, default: false)
- `supports_reasoning` (boolean, optional, default: false) — Whether the route supports reasoning.
- `reasoning` (PublicReasoningCapabilities, optional, nullable) — Reasoning controls the route supports, when it supports reasoning.

### ModelPricing

Pricing information for a model.

- `input_per_million` (double, required)
- `output_per_million` (double, required)
- `currency` ("USD", optional, default: USD)
- `flex` (TierPricing, optional, nullable) — Per-token pricing for the flex tier on this route, or null if the route does not offer it.
- `priority` (TierPricing, optional, nullable) — Per-token pricing for the priority tier on this route, or null if the route does not offer it.
- `ultrafast` (TierPricing, optional, nullable) — Per-token pricing for OpenAI's ultrafast tier on this route, or null if the route does not offer it.
- `unit` (enum, optional, default: per_token) — How the route bills: `per_token`, `per_second`, `per_image`, or `per_character`.
  - Allowed values: `per_token`, `per_second`, `per_image`, `per_character`
- `input_per_second` (double, optional, nullable) — USD per second of input, for duration-billed routes such as transcription.
- `output_per_second` (double, optional, nullable) — USD per second of generated output, for duration-billed routes such as video.
- `output_per_image` (double, optional, nullable) — USD per generated image, for flat-priced image routes.
- `input_per_character` (double, optional, nullable) — USD per input character, for text-to-speech routes.
- `output_per_audio_second` (double, optional, nullable) — Added USD per second of generated audio, for speech vendors that price by length.
- `input_image_per_million` (double, optional, nullable) — USD per million image-input tokens on image routes that accept reference images; null means the text input rate applies.
- `output_per_second_by_resolution` (map from string to double, optional, nullable) — Per-second rates keyed by output resolution; the flat rate is the default-resolution rate.
- `output_per_image_by_resolution` (map from string to double, optional, nullable) — Per-image rates keyed by output resolution; the flat rate is the default-resolution rate.
- `cache_read_per_million` (double, optional, nullable) — USD per million cached input tokens read.
- `cache_write_per_million` (double, optional, nullable) — USD per million input tokens written to the prompt cache.
- `batch` (TierPricing, optional, nullable) — Batch pricing, present only on routes that run `POST /v1/batches` jobs.
- `schedule` (list of SchedulePeriodPricing, optional, nullable) — Time-of-day rate windows; the flat rates apply outside every window.
- `long_context` (LongContextPricing, optional, nullable) — Rates that replace the base ones for the whole request once input passes a token threshold.

### ValidationErrorLocItems

### ValidationErrorCtx

### PublicReasoningCapabilities

Reasoning controls a route supports.

- `configurable` (boolean, optional, default: false) — Whether reasoning can be configured on this route.
- `disable_supported` (boolean, optional, default: false) — Whether reasoning can be turned off.
- `default_enabled` (boolean, optional, default: false) — Whether reasoning is on by default.
- `controls` (list of string, optional) — Request controls the route accepts for reasoning.
- `effort_values` (list of string, optional) — Accepted reasoning effort values.
- `output_style` (string, optional, nullable) — How the route returns reasoning, when known.

### TierPricing

Per-token pricing for a single service tier.

- `input_per_million` (double, required)
- `output_per_million` (double, required)

### SchedulePeriodPricing

Rates that replace the base ones inside a daily window; a null rate keeps the base rate.

- `name` (string, required) — Window name.
- `windows` (list of map from string to string, required) — Half-open `[start, end)` windows; a window whose end is at or before its start wraps midnight.
- `timezone` (string, optional, default: UTC) — Timezone the windows are expressed in.
- `days` (list of string, optional, nullable) — Days the windows apply on.
- `input_per_million` (double, optional, nullable)
- `output_per_million` (double, optional, nullable)
- `cache_read_per_million` (double, optional, nullable)
- `cache_write_per_million` (double, optional, nullable)

### LongContextPricing

Rates for the whole request once its input exceeds `threshold_tokens`; a null rate keeps the base rate.

- `threshold_tokens` (integer, required) — Input token count above which these rates apply.
- `input_per_million` (double, optional, nullable)
- `output_per_million` (double, optional, nullable)
- `cache_read_per_million` (double, optional, nullable)
- `cache_write_per_million` (double, optional, nullable)

## Examples

**Response**

```json
{
  "model": "string",
  "provider": "string",
  "display_name": "string",
  "vendors": {},
  "availability_status": "available",
  "created_at": "2024-01-15T09:30:00Z",
  "updated_at": "2024-01-15T09:30:00Z",
  "aliases": [
    {
      "model": "string",
      "type": "string",
      "display_name": "string",
      "description": "string"
    }
  ],
  "access_required": false,
  "access_reason": "string",
  "source": "self_hosted"
}
```

**SDK Code**

```python
import requests

url = "https://api-gateway.merge.dev/v1/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/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/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/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/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/models/model_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api-gateway.merge.dev/v1/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/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()
```