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

GET https://api-gateway.merge.dev/v1/model-aliases/{alias_id}

Get one model alias.

Needs `view_routing` or `manage_routing`.

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

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

- `alias_id` (string, required) — The alias's `id`.

## Response

### 200

The model alias

- `created_at` (datetime, required) — When the alias was created.
- `description` (string, required, nullable) — What the alias is for.
- `full_name` (string, required) — `@alias/<name>`, the value clients send as `model`.
- `id` (string, required) — The alias's id.
- `is_active` (boolean, required) — Whether the alias is active.
- `managed_by` ("routing_policy", required, nullable) — `routing_policy` for the slug a routing policy owns; null for your own aliases.
- `name` (string, required) — The alias, without the `@alias/` prefix.
- `project_id` (string, required, nullable) — The project the alias applies to; null for the whole organization.
- `target_model` (string, required, nullable) — Set when target_type is `model`.
- `target_policy_id` (string, required, nullable) — Set when target_type is `routing_config`.
- `target_type` (enum, required) — `model` resolves to one model; `routing_config` to a routing policy.
  - Allowed values: `model`, `routing_config`
- `updated_at` (datetime, required) — When the alias last changed.
- `vendor` (string, required, nullable) — The vendor the target model is pinned to, if any.

## 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
{
  "created_at": "2026-06-02T17:04:00Z",
  "description": "The model support-bot calls by default.",
  "full_name": "@alias/support-default",
  "id": "7f9b1d3e-5a2c-4e6b-8d0a-4b6d8f0a2c58",
  "is_active": true,
  "managed_by": null,
  "name": "support-default",
  "project_id": "8b6f2d4a-1c3e-4b5a-9f7d-2e0c6a8b4d91",
  "target_model": "anthropic/claude-sonnet-4-6",
  "target_policy_id": null,
  "target_type": "model",
  "updated_at": "2026-09-14T09:30:00Z",
  "vendor": "bedrock"
}
```

**SDK Code**

```python
import requests

url = "https://api-gateway.merge.dev/v1/model-aliases/alias_id"

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

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

print(response.json())
```

```javascript
const url = 'https://api-gateway.merge.dev/v1/model-aliases/alias_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/model-aliases/alias_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/model-aliases/alias_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/model-aliases/alias_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/model-aliases/alias_id', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp
using RestSharp;

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