> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portkey.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Adding Custom Models

> Learn how to add custom and fine-tuned models to your Prisma AIRS AI Gateway Model Catalog for seamless integration.

The AI Gateway's Model Catalog is designed to be a central hub for all the models you use, providing a unified interface for both supported and private models. By adding your custom or fine-tuned models to the catalog, you can seamlessly integrate them into your applications, leverage the AI Gateway's unified API signature, and benefit from centralized logging, monitoring, and management.

This is especially useful for:

* **Fine-tuned Models**: Integrating your fine-tuned versions of popular models (e.g., `ft:gpt-4.1-nano`).
* **Internal/Proprietary Models**: Using your own in-house models through the AI Gateway.
* **Models Not Natively Supported**: Adding models from providers that AI Gateway doesn't yet have a direct integration with, while mapping them to a compatible API signature.

## Adding a New Custom Model

You can add a custom model directly from Strata Cloud Manager.

1. Navigate to the relevant [**Integration**](https://stratacloudmanager.paloaltonetworks.com/) in your Strata Cloud Manager account, select the Integration for which you want to add a custom model.
2. Select the **Model Provisioning** step from steps.
3. Click the **Add Model** button on the top-right corner of the page.

This will open the **Add Custom Model** form.

### Configuration Fields

Here’s a breakdown of each field in the form:

<CardGroup>
  <Card title="Model Slug">
    A unique, lowercase identifier for your model (e.g., `my-custom-model-v1`). This slug is what you will use in your API requests to reference this model.
  </Card>

  <Card title="Short Description">
    An optional, brief description to help you and your team understand the model's purpose or version.
  </Card>

  <Card title="Model Type">
    Specify the nature of your model:

    * **Fine-tuned model**: Select this if you are adding a fine-tuned version of a base model (like `ft:gpt-3.5-turbo`).
    * **Custom model**: Select this for any other model, such as proprietary in-house models.
  </Card>

  <Card title="Base Model">
    Select an existing model that your custom model is based on in terms of **API compatibility**. For example, if your custom model accepts the same request payload and returns the same response structure as `gpt-4`, you would select `gpt-4` here. This ensures the AI Gateway can correctly format requests and parse responses.
  </Card>

  <Card title="Add custom pricing for this model?">
    Enable this toggle if you want to associate specific input and output costs with your model. This is useful for accurate cost tracking and budget management within the AI Gateway's dashboard.
  </Card>
</CardGroup>

## Per-model custom host and headers

Each integration model can carry its own routing config — useful when several custom models share one integration but hit different upstreams or need different headers.

| Field            | Purpose                                                                           |
| :--------------- | :-------------------------------------------------------------------------------- |
| `custom_host`    | Upstream base URL for this model (e.g. a private or regional endpoint)            |
| `custom_headers` | String-to-string map of headers the AI Gateway sends with requests for this model |

**Precedence**

* Model-level `custom_headers` override integration-level `custom_headers` for that model.
* A request-time / header-level `custom_host` still takes priority over the model-level value.

Configure via the [Update Model Access](/docs/api-reference/admin-api/control-plane/integrations/models/update-model-access) API (`models[].configurations`), or set the fields when editing the model in Model Provisioning.

```bash theme={"system"}
curl -X PUT "https://aigw.portkey.ai/v1/integrations/YOUR_INTEGRATION_SLUG/models" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PORTKEY_API_KEY" \
  -d '{
    "models": [
      {
        "slug": "my-custom-model-v1",
        "enabled": true,
        "is_custom": true,
        "base_model_slug": "gpt-4o",
        "configurations": {
          "custom_host": "https://llm.internal.example.com/v1",
          "custom_headers": {
            "x-tenant-id": "acme-prod",
            "x-region": "us-east-1"
          }
        }
      }
    ]
  }'
```

<Note>
  `custom_headers` must be a flat string-to-string object. See [Custom hosts](/docs/aigw/product/ai-gateway/custom-hosts) for URL validation rules on `custom_host`.
</Note>

## Using Your Custom Model

Once you've added your custom model, you can use it just like any other model in the catalog. Simply reference its **Model Slug** in your API calls.

For example, to use a custom model with the slug `my-custom-model-v1` in a chat completion request, you would set it as the `model` in your provider configuration or pass it directly in the request header:

<Tabs>
  <Tab title="cURL">
    ```bash theme={"system"}
    curl -X POST https://aigw.portkey.ai/v1/chat/completions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_PORTKEY_API_KEY" \
      -d '{
        "model": "@provider/my-custom-model-v1",
        "messages": [
          {
            "role": "user",
            "content": "Hello, what can you do?"
          }
        ]
      }'
    ```
  </Tab>
</Tabs>

The AI Gateway will route the request to the provider associated with the base model you selected, using your custom model's slug.


## Related topics

- [Model Catalog](/docs/aigw/product/model-catalog.md)
- [Azure AI Foundry](/docs/aigw/integrations/llms/azure-foundry.md)
- [Google Vertex AI](/docs/aigw/integrations/llms/vertex-ai.md)
- [Azure OpenAI](/docs/aigw/integrations/llms/azure-openai/azure-openai.md)
- [OpenAI Codex](/docs/aigw/integrations/libraries/codex.md)
