Skip to content
🎯 New workshop: Govern AI Costs in Real Time — Hands-On with agentgateway agentgateway has joined the Agentic AI FoundationLearn more

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

Page as Markdown

Custom

Configure agentgateway for providers without built-in support that implement the OpenAI API format.

Use this page for providers that implement the OpenAI API format but do not have a first-class provider: support yet. For built-in providers such as Baseten, Cerebras, Cohere, DeepInfra, DeepSeek, Fireworks AI, Groq, Hugging Face, Mistral, OpenRouter, Together AI, xAI, and Ollama, use the dedicated provider pages instead.

Many providers provide “OpenAI compatible” or “Anthropic compatible” endpoints. While these can be used with provider: openai/provider: anthropic and a customized baseUrl, prefer to use provider: custom.

Using a specific vendor’s provider may introduce semantics specific to that provider.

Before you begin

Install the agentgateway binary.

You also need the following prerequisites.

  • An API key for your chosen provider, unless you are pointing to a local endpoint such as vLLM or LM Studio.

Configuring a custom provider

With a custom provider, you provide the API endpoint and a list of formats it supports. Agentgateway will automatically handle mapping between the incoming format and the supported formats.

Below shows an example of connecting to Perplexity, which exposes an OpenAI-compatible API for search-augmented models and does not currently have a first-class provider.

cat > /tmp/test-perplexity.yaml << 'EOF'
# yaml-language-server: $schema=https://agentgateway.dev/schema/config
llm:
  models:
  - name: "*"
    provider:
      custom:
        formats:
          # Indicate this provider supports the completions API. With no `path` specified, this defaults to <baseUrl>/chat/completions
          - type: completions
          # Indicate this provider supports the messages API, on a custom path /messages-api
          # - type: messages
          #   path: /messages-api
          # All possible APIs:
          # - type: embeddings
          # - type: responses
          # - type: realtime
          # - type: anthropicTokenCount
          # - type: rerank
    params:
      apiKey: "$PERPLEXITY_API_KEY"
      model: llama-3.1-sonar-large-128k-online
      baseUrl: "https://api.perplexity.ai"
EOF
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/.