Skip to content
Help guide the future of agentgateway — Take the survey

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Nebius Token Factory

Page as Markdown

Configure Nebius Token Factory as an LLM provider for agentgateway.

Configure Nebius Token Factory as an LLM provider in agentgateway. The Nebius preset uses https://api.tokenfactory.nebius.com/v1 as the default base URL. The preset serves Chat Completions and Embeddings requests.

Before you begin

  1. Install and set up an agentgateway proxy.
  2. Allow the AgentgatewayModel route kind on the http listener of the agentgateway-proxy Gateway. For the steps, see Enable LLM serving on a listener.
  3. Get a Nebius API key and choose a Nebius model. The following examples use openai/gpt-oss-120b for Chat Completions and Qwen/Qwen3-Embedding-8B for embeddings.

Set up Nebius

Store your Nebius API key in a Secret. Then, create a model that uses the Nebius preset. The model attaches directly to the Gateway listener, so you do not create an AgentgatewayBackend or an HTTPRoute.

  1. Save the API key in an environment variable.

    export NEBIUS_API_KEY='<your-api-key>'
  2. Create a Kubernetes Secret to store your API key.

    kubectl apply -f- <<EOF
    apiVersion: v1
    kind: Secret
    metadata:
      name: nebius-secret
      namespace: agentgateway-system
    type: Opaque
    stringData:
      Authorization: $NEBIUS_API_KEY
    EOF
  3. Create an AgentgatewayModel that uses the Nebius preset and references the Secret.

    kubectl apply -f- <<EOF
    apiVersion: agentgateway.dev/v1alpha1
    kind: AgentgatewayModel
    metadata:
      name: nebius-chat
      namespace: agentgateway-system
    spec:
      parentRefs:
      - group: gateway.networking.k8s.io
        kind: Gateway
        name: agentgateway-proxy
        sectionName: http
      match:
        model: openai/gpt-oss-120b
      provider: Nebius
      policies:
        auth:
          secretRef:
            name: nebius-secret
    EOF

    Review the following table to understand this configuration. For more information, see the API docs.

    SettingDescription
    spec.match.modelThe model name that clients send in requests.
    spec.providerThe Nebius preset. The preset supplies the default URL, https://api.tokenfactory.nebius.com/v1, and the Chat Completions and Embeddings request formats.
    spec.policies.auth.secretRefThe Secret that holds your Nebius API key.
  4. Send a Chat Completions request to the model.

    curl "http://$INGRESS_GW_ADDRESS/v1/chat/completions" \
      -H 'Content-Type: application/json' \
      -d '{
        "model": "openai/gpt-oss-120b",
        "messages": [{"role": "user", "content": "Explain model routing in one sentence."}]
      }' | jq

To serve embeddings, create another AgentgatewayModel that uses provider: Nebius and a Nebius embedding model, such as Qwen/Qwen3-Embedding-8B. Then, clients can send embeddings requests to /v1/embeddings with that model name.

Cleanup

You can remove the resources that you created in this guide.
kubectl delete AgentgatewayModel nebius-chat -n agentgateway-system
kubectl delete secret nebius-secret -n agentgateway-system
Was this page helpful?
Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate ↵ select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.