Connect apps

Your own application

Your code keeps using the OpenAI or Anthropic SDK it already uses. Change the base URL and the key; nothing else.

Get a key with the right protection
In the console, open Connect an app (opens in a new tab) and pick this tool. AgentKeyRoute recommends a governance profile, creates the key, and shows these same steps with your key and an allowed model filled in, plus a live test.
  1. Install an SDK
    pip install openai
  2. Call the gateway
    from openai import OpenAI
    
    client = OpenAI(base_url="https://gateway.agentkeyroute.com/v1", api_key="<your API key>")
    resp = client.chat.completions.create(
        model="gpt-4.1",
        messages=[{"role": "user", "content": "Hello"}],
        extra_headers={"X-AIGov-User": "<end user id>"},
    )
    print(resp.choices[0].message.content)
  3. Attribute requests to people

    Send X-AIGov-User with the signed-in user's ID (as in the Python example), so audit records and per-person reports show who asked, not just which app.

Choosing what to connect in the wizard

PickWhen
Chatbot or assistantAnswers questions for people.
Search & document Q&ARetrieval over your documents (RAG).
Workflow agentTakes actions in other systems; registered as autonomous.
Your own applicationAnything else, including tools not listed in these docs that accept an OpenAI or Anthropic base URL.

See Endpoints & examples for streaming, tools, embeddings, images and more.