Quickstarts

One OpenAI-compatible key for our own models and the market. Base URL https://api.llm-broker.net/api/v1, model: "taylor" for the strongest measured model, or any id from /api/v1/broker/models. Criteria per request go into routing; every non-streaming answer carries broker (region, cost, routing applied). No key yet? POST /api/v1/broker/accounts — card at Stripe, key exactly once.

Try now, no account (key ast_try, model elliot)curlPython (OpenAI SDK)LangChain / LangGraphCrewAIAutoGenLlamaIndexMCP (Claude Desktop, Cursor, Cline)Which model? (free, no key)OpenCodeCline, Roo Code, Kilo Code, ContinueLiteLLMVercel AI SDKn8n, Cursor, other OpenAI-compatible tools

Try now, no account (key ast_try, model elliot)

# free trial: elliot or elliot-unchained, 10 million output tokens per IP in 30 days
curl -s https://api.llm-broker.net/api/v1/chat/completions \
  -H "Authorization: Bearer ast_try" \
  -H "Content-Type: application/json" \
  -d '{"model": "elliot",
       "messages": [{"role": "user", "content": "Say OK"}]}'

curl

curl -s https://api.llm-broker.net/api/v1/chat/completions \
  -H "Authorization: Bearer $BROKER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "taylor",
       "messages": [{"role": "user", "content": "Say OK"}],
       "routing": {"category": "coding", "level": "best"}}'

Python (OpenAI SDK)

pip install openai

import os
from openai import OpenAI

client = OpenAI(base_url="https://api.llm-broker.net/api/v1", api_key=os.environ["BROKER_API_KEY"])
r = client.chat.completions.create(
    model="taylor",
    messages=[{"role": "user", "content": "Say OK"}],
    # criteria per request; the broker picks the cheapest offer that meets them
    extra_body={"routing": {"category": "coding", "level": "best"}},
)
print(r.choices[0].message.content)
print(getattr(r, "broker", None))  # region, cost, routing applied

LangChain / LangGraph

pip install langchain langchain-openai

import os
from langchain_openai import ChatOpenAI
from langchain.agents import create_agent  # LangGraph 1.0 agent runtime

llm = ChatOpenAI(
    model="taylor",
    base_url="https://api.llm-broker.net/api/v1",
    api_key=os.environ["BROKER_API_KEY"],
    extra_body={"routing": {"category": "reasoning", "level": "strong"}},
)
agent = create_agent(llm, tools=[])
out = agent.invoke({"messages": [("user", "Say OK")]})
print(out["messages"][-1].content)

CrewAI

pip install crewai

import os
from crewai import LLM

# "openai/" tells CrewAI to speak the OpenAI protocol to our base_url
llm = LLM(model="openai/taylor", base_url="https://api.llm-broker.net/api/v1", api_key=os.environ["BROKER_API_KEY"])
print(llm.call("Say OK"))
# use it in an agent: Agent(role=..., goal=..., backstory=..., llm=llm)

AutoGen

pip install autogen-agentchat "autogen-ext[openai]"

import asyncio, os
from autogen_agentchat.agents import AssistantAgent
from autogen_ext.models.openai import OpenAIChatCompletionClient

client = OpenAIChatCompletionClient(
    model="taylor",
    base_url="https://api.llm-broker.net/api/v1",
    api_key=os.environ["BROKER_API_KEY"],
    model_info={"vision": False, "function_calling": True, "json_output": True,
                "family": "unknown", "structured_output": True},
)

async def main():
    agent = AssistantAgent("assistant", model_client=client)
    result = await agent.run(task="Say OK")
    print(result.messages[-1].content)

asyncio.run(main())

LlamaIndex

pip install llama-index-llms-openai-like

import os
from llama_index.llms.openai_like import OpenAILike

llm = OpenAILike(model="taylor", api_base="https://api.llm-broker.net/api/v1", api_key=os.environ["BROKER_API_KEY"],
                 is_chat_model=True, context_window=128000)
print(llm.complete("Say OK"))

MCP (Claude Desktop, Cursor, Cline)

Registry: net.llm-broker/broker

{
  "mcpServers": {
    "llm-broker": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://api.llm-broker.net/api/v1/broker/mcp",
               "--header", "Authorization: Bearer ${BROKER_API_KEY}"],
      "env": {"BROKER_API_KEY": "ast_sk_…"}
    }
  }
}

Which model? (free, no key)

# best and best-value model for a task, from our own benchmark scores and list prices
curl -s "https://api.llm-broker.net/api/v1/broker/recommend?category=coding&max_price_per_mtok=5&currency=USD"
# the answer carries a ready `routing` object for /chat/completions

OpenCode

// opencode.json — then: /models → llm-broker
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "llm-broker": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "LLM Broker",
      "options": { "baseURL": "https://api.llm-broker.net/api/v1", "apiKey": "{env:BROKER_API_KEY}" },
      "models": { "taylor": { "name": "LLM Broker (routed)" } }
    }
  }
}

Cline, Roo Code, Kilo Code, Continue

Cline / Roo / Kilo:  API Provider = "OpenAI Compatible"
                     Base URL = https://api.llm-broker.net/api/v1   API Key = ast_sk_…   Model ID = taylor

Continue (config.yaml):
  models:
    - name: LLM Broker
      provider: openai
      model: taylor
      apiBase: https://api.llm-broker.net/api/v1
      apiKey: ${{ secrets.BROKER_API_KEY }}

LiteLLM

pip install litellm

import os, litellm

r = litellm.completion(
    model="openai/taylor",          # openai/ = OpenAI-compatible endpoint
    api_base="https://api.llm-broker.net/api/v1",
    api_key=os.environ["BROKER_API_KEY"],
    messages=[{"role": "user", "content": "Say OK"}],
    extra_body={"routing": {"category": "coding", "level": "best"}},
)
print(r.choices[0].message.content)

Vercel AI SDK

npm install ai @ai-sdk/openai-compatible

import { createOpenAICompatible } from "@ai-sdk/openai-compatible";
import { generateText } from "ai";

const broker = createOpenAICompatible({
  name: "llm-broker",
  baseURL: "https://api.llm-broker.net/api/v1",
  apiKey: process.env.BROKER_API_KEY,
});

const { text } = await generateText({ model: broker("taylor"), prompt: "Say OK" });
console.log(text);

n8n, Cursor, other OpenAI-compatible tools

Credential / provider type: OpenAI (or "OpenAI-compatible")
Base URL:  https://api.llm-broker.net/api/v1
API key:   ast_sk_…
Model:     taylor   (or any id from GET /api/v1/broker/models)