> ## 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.
4. In the **Add Custom Model** form, enter the **Model Slug** and an optional **Short Description**.
5. Choose a **Model Type**: **Fine-tuned Model** or **Custom Model**. If you pick Fine-tuned Model, select the **Base Model** it is based on.
6. Optionally, turn on **Add custom pricing for this model** and enter the input cost, output cost, and cache pricing.
7. Optionally, turn on **Pricing Adjustments** to apply a discount or markup multiplier to this model.
8. Optionally, set a **Custom Host** and any **Custom Headers** for this model.
9. Click **Apply** to save the model.

### Configuration Fields

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

> [card] 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] Short Description
>
> An optional, brief description to help you and your team understand the model's purpose or version.

> [card] Model Type
>
> Specify the nature of your model:
>
> * **Fine-tuned Model** (based on an existing model): Select this if you are adding a fine-tuned version of a base model (like `ft:gpt-3.5-turbo`). Selecting this option shows the **Base Model** field.
> * **Custom Model** (self hosted or proprietary): Select this for any other model, such as proprietary in-house models.

> [card] Base Model (Fine-tuned Model only)
>
> Select an existing model that your fine-tuned model is based on in terms of **API compatibility**. For example, if your 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] Add custom pricing for this model
>
> Enable this toggle if you want to associate specific costs with your model. This is useful for accurate cost tracking and budget management within the AI Gateway's dashboard. Once enabled, you can set:
>
> * **Input Cost**: Price for input (request) tokens.
> * **Output Cost**: Price for output (response) tokens.
> * **Cache Pricing**: Optional JSON for cache token prices, for example `{"cache_write_input_token": {"price": 3.75}, "cache_read_input_token": {"price": 0.3}}`.

> [card] Pricing Adjustments
>
> Enable this toggle to apply a discount or markup multiplier to this model's base price. Pick **Default** mode for the common token types (default, request, response, cache read, cache write), or **Custom** mode to provide the full multiplier as JSON. A multiplier of `1` leaves pricing unchanged, `0.8` is a 20% discount, and `1.2` is a 20% markup. See [Per-Model Pricing Adjustments](https://docs.portkey.ai/docs/aigw/product/model-catalog/pricing-adjustments.md#per-model-pricing-adjustments) for details and version requirements.

> [card] Custom Host (Optional)
>
> The upstream base URL for this model, for example `https://your-custom-endpoint.com`. See [Per-model custom host and headers](#per-model-custom-host-and-headers).

> [card] Custom Headers
>
> Header name and value pairs that the AI Gateway sends with requests for this model. Click **Add Header** to add more rows.

> [!NOTE]
>
> A model with custom pricing is billed at exactly that price. [Pricing adjustments](https://docs.portkey.ai/docs/aigw/product/model-catalog/pricing-adjustments.md#per-model-pricing-adjustments) set at the model level or the Integration level are ignored for it. Build any discount or markup into the custom price itself.

## 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](https://docs.portkey.ai/docs/aigw/api-reference/integrations/models/put-integrations-by-slug-models.md) API (`models[].configurations`), or set the **Custom Host** and **Custom Headers** fields when adding or 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](https://docs.portkey.ai/docs/aigw/product/ai-gateway/custom-hosts.md) for URL validation rules on `custom_host`.

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

> [tab] 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?"
>       }
>     ]
>   }'
> ```

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](https://docs.portkey.ai/docs/aigw/product/model-catalog.md)
- [Azure AI Foundry](https://docs.portkey.ai/docs/aigw/integrations/llms/azure-foundry.md)
- [AI Model Provisioning](https://docs.portkey.ai/docs/aigw/product/model-catalog/model-provisioning.md)
- [Model Pricing and Cost Management](https://docs.portkey.ai/docs/aigw/product/observability/cost-management.md)
- [Google Vertex AI](https://docs.portkey.ai/docs/aigw/integrations/llms/vertex-ai.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.