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

# Get a model

GET https://api.respan.ai/api/models/{model_name}/

Retrieve a built-in or custom model by model name. Custom models are only visible to the owning organization.

Reference: https://respan.ai/docs/apis/models/get-model

## Authentication

- `Authorization` header (bearer token, required) — Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer \<RESPAN\_API\_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan\_params.credential\_override in the request body, not in this authentication field.
- `Authorization` header (bearer token, required) — Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

## Request

### Path parameters

- `model_name` (string, required) — The `model_name` that List models returns. Built-in models are provider-prefixed, such as `openai/gpt-4o-mini`; bare names such as `gpt-4o-mini` return 404.

## Response

### 200

Model details.

- `id` (string, required) — Model string ID. Same value as `model_name`.
- `model_name` (string, required) — Model name used in API calls.
- `base_model_name` (string, optional) — Base model inherited from, when configured.
- `affiliation_category` (enum, optional) — `keywordsai` for built-in models, `custom` for your organization's models.
  - Allowed values: `keywordsai`, `custom`
- `is_called_by_custom_name` (boolean, optional) — Whether requests are sent upstream using this custom model name.
- `input_cost` (double, optional) — Cost per 1M input tokens in USD.
- `output_cost` (double, optional) — Cost per 1M output tokens in USD.
- `cache_hit_input_cost` (double, optional) — Cost per 1M cached input tokens in USD.
- `cache_creation_input_cost` (double, optional) — Cost per 1M cache creation input tokens in USD.
- `max_context_window` (integer, optional) — Maximum context window size.
- `function_call` (enum, optional) — Function/tool calling support. `0` = no, `1` = yes.
  - Allowed values: `0`, `1`
- `image_support` (enum, optional) — Vision input support. `0` = no, `1` = yes.
  - Allowed values: `0`, `1`
- `model_type` (enum, optional) — Model type.
  - Allowed values: `chat`, `embedding`, `audio`
- `supported_params` (map from string to any, optional) — Computed parameter support after applying model-specific overrides.
- `provider` (ApiModelsModelNameGetResponsesContentApplicationJsonSchemaProvider, optional, nullable)

## Errors

### 403 Forbidden Error

The API key is missing, invalid or expired.

- `detail` (string, required)

### 404 Not Found Error

Not Found

- `detail` (string, optional)
- `error` (string, optional)

## Types

### ApiModelsModelNameGetResponsesContentApplicationJsonSchemaProvider

- `id` (string, required) — Provider string ID. Same value as `provider_id`.
- `provider_id` (string, required) — Unique provider identifier within your organization.
- `provider_name` (string, required) — Human-readable provider name.
- `extra_kwargs` (map from string to any, optional) — Provider configuration such as `base_url` and timeout values. Secret values are not returned here.
- `created_at` (datetime, optional, nullable)
- `updated_at` (datetime, optional, nullable)

## Examples

**Response**

```json
{
  "id": "my-custom-gpt-4o",
  "model_name": "my-custom-gpt-4o",
  "base_model_name": "gpt-4o",
  "affiliation_category": "custom",
  "is_called_by_custom_name": false,
  "input_cost": 2.5,
  "output_cost": 10,
  "cache_hit_input_cost": 0.5,
  "cache_creation_input_cost": 3,
  "max_context_window": 128000,
  "function_call": 1,
  "image_support": 1,
  "model_type": "chat",
  "supported_params": {},
  "provider": {
    "id": "my-vllm",
    "provider_id": "my-vllm",
    "provider_name": "My vLLM Server",
    "extra_kwargs": {
      "base_url": "https://vllm.example.com/v1"
    },
    "created_at": "2024-01-15T09:30:00Z",
    "updated_at": "2024-01-15T09:30:00Z"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.respan.ai/api/models/model_name/"

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

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

print(response.json())
```

```javascript
const url = 'https://api.respan.ai/api/models/model_name/';
const options = {method: 'GET', headers: {Authorization: 'Bearer <respanApiKey>'}};

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.respan.ai/api/models/model_name/"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <respanApiKey>")

	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.respan.ai/api/models/model_name/")

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

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

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.respan.ai/api/models/model_name/")
  .header("Authorization", "Bearer <respanApiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.respan.ai/api/models/model_name/', [
  'headers' => [
    'Authorization' => 'Bearer <respanApiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.respan.ai/api/models/model_name/");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <respanApiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.respan.ai/api/models/model_name/")! 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()
```