# BYOK custom models

{% hint style="info" %}
**Available in Stratix Premium.** This surface is part of the logged-in workspace at [stratix.layerlens.ai](https://stratix.layerlens.ai). Stratix Public users can browse the catalog but cannot use this feature.
{% endhint %}

Stratix supports registering **OpenAI-compatible endpoints** as custom models. The custom model is treated as first-class: you can use it in evaluations, compare it against public models, score traces from it, and apply judges and scorers — exactly like a public model.

## When to use BYOK

* You're running a self-hosted model
* You're using a private inference endpoint
* You're using a partner cloud (Fireworks, Nebius, SambaNova, MLflow, etc.) with an OpenAI-compatible API
* You want to keep model API tokens billing under your own provider account, not as ECU

## Registering a custom model

1. **Premium → Models → Register custom model**
2. Provide:

* **Name** — display name for your team
* **Endpoint URL** — `https://api.example.com/v1` (an OpenAI-compatible base URL)
* **API key** — secret stored encrypted in your org's BYOK vault
* **Model identifier** — what to send as `model:` in the request
* **Capability tags** — what the model is good for

3. **Test connection** — Stratix sends a probe request and confirms the endpoint responds
4. **Save**

## What happens at evaluation time

When you select a BYOK custom model in an evaluation:

* Stratix sends inference requests to your endpoint
* Token usage bills against your provider, not against ECU
* Judges, scorers, and trace evaluations work exactly as for public models
* Latency, error rates, and cost-per-call are tracked in the evaluation results

## Compatible providers

Any OpenAI-compatible API works. Tested with:

* vLLM (self-hosted)
* Together AI
* Fireworks AI
* Nebius
* SambaNova Cloud
* MLflow gateways
* Custom endpoints behind a reverse proxy

If your provider isn't OpenAI-compatible, see if the SDK exposes a compatibility layer.

## Security

* API keys are encrypted at rest in the org's BYOK vault
* Keys are never returned via the API; only the masked prefix is shown
* Org-scoped: only members with the `models:write` permission can register or rotate keys

## Where to next

* [Concept: BYOK models](/5.-select-pick-the-model/byok-models.md)
* [Models](/5.-select-pick-the-model/models.md)
* [Settings](/11.-admin/settings.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.layerlens.ai/5.-select-pick-the-model/byok-custom-models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
