---
title: "Get a model"
description: "Returns one model, in the same format as the model list."
---

<a id="playground-button:docs/apis/models/get-model"></a>

**GET** `https://api.respan.ai/api/v1/models/{model}`

Returns one model, in the same format as the model list.

Returns `404` if the model does not exist or your project cannot use it.

## Servers

`https://api.respan.ai` — Respan API Server

<a id="request.auth"></a>

## Authentication

Authentication is optional.

<a id="request.auth.Authorization"></a>

### RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer &lt;RESPAN_API_KEY&gt;. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -&gt; Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: `bearer`; format: `Respan API key`.


```http
Authorization: Bearer $RESPAN_API_KEY
```


<a id="request.path"></a>

## Path parameters


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| <a id="request.path.model"></a>`model` | `string` | Required | The model ID, as returned in `id`. IDs can contain slashes, such as `openrouter/openai/gpt-4o`.<br />Example: `"gpt-4o-mini"` |


<a id="response"></a>

## Responses

### 200

The model.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Reference: `#/components/schemas/OpenAIModel` |
| `id` | `string` | Required in parent | Model ID. Send it as `model` in gateway requests.<br />Example: `"gpt-4o-mini"` |
| `object` | `string` | Required in parent | Allowed: `"model"`<br />Example: `"model"` |
| `created` | `integer` | Required in parent | Release date as a Unix timestamp, or `0` if unknown.<br />Example: `1721260800` |
| `owned_by` | `string` | Required in parent | The organization that develops the model.<br />Example: `"openai"` |
| `context_length` | `integer or null` | Required in parent | Context window in tokens, or `null` if unknown.<br />Example: `128000` |
| `pricing` | `object` | Required in parent | Prices in USD.<br />Reference: `#/components/schemas/OpenAIModelPricing` |
| `pricing.input_cost` | `number or null` | Required in parent | Input price per `input_price_unit`, after the Respan discount and the time-of-day schedule in effect now. Token and character prices are per 1M.<br />Example: `0.15` |
| `pricing.output_cost` | `number or null` | Required in parent | Output price per `output_price_unit`, after the Respan discount and the time-of-day schedule in effect now. Token and character prices are per 1M.<br />Example: `0.6` |
| `pricing.input_price_unit` | `string` | Required in parent | Unit for `input_cost`.<br />Allowed: `"token"`, `"image"`, `"second"`, `"minute"`, `"hour"`, `"character"`<br />Example: `"token"` |
| `pricing.output_price_unit` | `string` | Required in parent | Unit for `output_cost`.<br />Allowed: `"token"`, `"image"`, `"second"`, `"minute"`, `"hour"`, `"character"`<br />Example: `"token"` |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "$ref": "#/components/schemas/OpenAIModel"
}
```

</details>

##### Example


```json
{
  "id": "gpt-4o-mini",
  "object": "model",
  "created": 1721260800,
  "owned_by": "openai",
  "context_length": 128000,
  "pricing": {
    "input_cost": 0.15,
    "output_cost": 0.6,
    "input_price_unit": "token",
    "output_price_unit": "token"
  }
}
```


### 404

The model does not exist or your project cannot use it.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Reference: `#/components/schemas/OpenAIModelNotFoundError` |
| `error` | `object` | Required in parent | — |
| `error.message` | `string` | Required in parent | Example: `"The model 'gpt-9' does not exist or you do not have access to it. List available models with GET /api/v1/models."` |
| `error.type` | `string` | Required in parent | Example: `"invalid_request_error"` |
| `error.param` | `string` | Required in parent | Example: `"model"` |
| `error.code` | `string` | Required in parent | Example: `"model_not_in_catalog"` |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "$ref": "#/components/schemas/OpenAIModelNotFoundError"
}
```

</details>

## OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

<!-- openapi-operation:start -->
<details class="api-schema-source">
<summary>OpenAPI operation</summary>


```json
{
  "summary": "Get a model",
  "operationId": "getModel",
  "tags": [
    "Models"
  ],
  "description": "Returns one model, in the same format as the model list.\n\nReturns `404` if the model does not exist or your project cannot use it.",
  "parameters": [
    {
      "name": "model",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "The model ID, as returned in `id`. IDs can contain slashes, such as `openrouter/openai/gpt-4o`.",
      "example": "gpt-4o-mini"
    }
  ],
  "responses": {
    "200": {
      "description": "The model.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/OpenAIModel"
          },
          "example": {
            "id": "gpt-4o-mini",
            "object": "model",
            "created": 1721260800,
            "owned_by": "openai",
            "context_length": 128000,
            "pricing": {
              "input_cost": 0.15,
              "output_cost": 0.6,
              "input_price_unit": "token",
              "output_price_unit": "token"
            }
          }
        }
      }
    },
    "404": {
      "description": "The model does not exist or your project cannot use it.",
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/OpenAIModelNotFoundError"
          }
        }
      }
    }
  },
  "security": [
    {},
    {
      "RespanApiKey": []
    }
  ]
}
```

</details>
<!-- openapi-operation:end -->

<!-- openapi-path-item:start -->
<details class="api-schema-source">
<summary>OpenAPI path metadata</summary>


```json
{}
```

</details>
<!-- openapi-path-item:end -->

<!-- openapi-components:start -->
<details class="api-schema-source">
<summary>Referenced OpenAPI components</summary>


```json
{
  "schemas": {
    "OpenAIModel": {
      "type": "object",
      "required": [
        "id",
        "object",
        "created",
        "owned_by",
        "context_length",
        "pricing"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Model ID. Send it as `model` in gateway requests.",
          "example": "gpt-4o-mini"
        },
        "object": {
          "type": "string",
          "enum": [
            "model"
          ],
          "example": "model"
        },
        "created": {
          "type": "integer",
          "description": "Release date as a Unix timestamp, or `0` if unknown.",
          "example": 1721260800
        },
        "owned_by": {
          "type": "string",
          "description": "The organization that develops the model.",
          "example": "openai"
        },
        "context_length": {
          "type": "integer",
          "nullable": true,
          "description": "Context window in tokens, or `null` if unknown.",
          "example": 128000
        },
        "pricing": {
          "$ref": "#/components/schemas/OpenAIModelPricing"
        }
      }
    },
    "OpenAIModelNotFoundError": {
      "type": "object",
      "required": [
        "error"
      ],
      "properties": {
        "error": {
          "type": "object",
          "required": [
            "message",
            "type",
            "param",
            "code"
          ],
          "properties": {
            "message": {
              "type": "string",
              "example": "The model 'gpt-9' does not exist or you do not have access to it. List available models with GET /api/v1/models."
            },
            "type": {
              "type": "string",
              "example": "invalid_request_error"
            },
            "param": {
              "type": "string",
              "example": "model"
            },
            "code": {
              "type": "string",
              "example": "model_not_in_catalog"
            }
          }
        }
      }
    },
    "OpenAIModelPricing": {
      "type": "object",
      "description": "Prices in USD.",
      "required": [
        "input_cost",
        "output_cost",
        "input_price_unit",
        "output_price_unit"
      ],
      "properties": {
        "input_cost": {
          "type": "number",
          "nullable": true,
          "description": "Input price per `input_price_unit`, after the Respan discount and the time-of-day schedule in effect now. Token and character prices are per 1M.",
          "example": 0.15
        },
        "output_cost": {
          "type": "number",
          "nullable": true,
          "description": "Output price per `output_price_unit`, after the Respan discount and the time-of-day schedule in effect now. Token and character prices are per 1M.",
          "example": 0.6
        },
        "input_price_unit": {
          "type": "string",
          "enum": [
            "token",
            "image",
            "second",
            "minute",
            "hour",
            "character"
          ],
          "description": "Unit for `input_cost`.",
          "example": "token"
        },
        "output_price_unit": {
          "type": "string",
          "enum": [
            "token",
            "image",
            "second",
            "minute",
            "hour",
            "character"
          ],
          "description": "Unit for `output_cost`.",
          "example": "token"
        }
      }
    }
  },
  "securitySchemes": {
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "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.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}
```

</details>
<!-- openapi-components:end -->
