Agent SDKs
Connect agents you build with an agent SDK to the LLM gateway by setting two parameters: the inference endpoint (base URL) and the auth token. Most agent SDKs expose both, so your agent's model calls run under your gateway policy's access, budget, and model restrictions like any other harness.
1. Install the mintive CLI
Install through the local installer or MDM rollout first, so the client machine manages its own auth state. Your agent then reads a token from mintive auth token instead of storing a credential itself.
2. Configure your agent in the SDK
Point the SDK at the gateway endpoint for your region, pass the output of mintive auth token as the API key, and use mintmcp/inference as the model to get your policy's default model.
| Region | Base URL for Anthropic-style SDKs | Base URL for OpenAI-style SDKs |
|---|---|---|
| US (default) | https://app.mintmcp.com/inference | https://app.mintmcp.com/inference/v1 |
| EU | https://eu.mintmcp.com/inference | https://eu.mintmcp.com/inference/v1 |
The token is short-lived, so fetch it when your agent starts, and fetch it again if a long-running agent gets a 401. mintive auth token refreshes it for you when it's expired.
- OpenAI Agents SDK
- Claude Agent SDK
- Vercel AI SDK
import subprocess
from agents import Agent, OpenAIResponsesModel, Runner, set_tracing_disabled
from openai import AsyncOpenAI
token = subprocess.run(
["mintive", "auth", "token"], capture_output=True, text=True, check=True
).stdout.strip()
client = AsyncOpenAI(base_url="https://app.mintmcp.com/inference/v1", api_key=token)
# Tracing uploads to OpenAI with your default OpenAI key, not the gateway token.
set_tracing_disabled(True)
agent = Agent(
name="Assistant",
instructions="You are a helpful assistant.",
model=OpenAIResponsesModel(model="mintmcp/inference", openai_client=client),
)
result = Runner.run_sync(agent, "Summarize the open issues in this repository.")
print(result.final_output)
The Claude Agent SDK runs Claude Code, so pass the gateway through its environment and use claude-mintmcp-mintmcp-inference, the Claude-style name for your policy's default model.
import { execFileSync } from "node:child_process";
import { query } from "@anthropic-ai/claude-agent-sdk";
const token = execFileSync("mintive", ["auth", "token"], { encoding: "utf8" }).trim();
for await (const message of query({
prompt: "Summarize the open issues in this repository.",
options: {
model: "claude-mintmcp-mintmcp-inference",
env: {
...process.env,
ANTHROPIC_BASE_URL: "https://app.mintmcp.com/inference",
ANTHROPIC_AUTH_TOKEN: token,
},
},
})) {
if (message.type === "result" && message.subtype === "success") {
console.log(message.result);
}
}
import { execFileSync } from "node:child_process";
import { createOpenAI } from "@ai-sdk/openai";
import { generateText } from "ai";
const token = execFileSync("mintive", ["auth", "token"], { encoding: "utf8" }).trim();
const mintive = createOpenAI({
baseURL: "https://app.mintmcp.com/inference/v1",
apiKey: token,
});
const { text } = await generateText({
model: mintive("mintmcp/inference"),
prompt: "Summarize the open issues in this repository.",
});
console.log(text);
Any agent SDK that lets you adjust the inference endpoint and auth token works the same way. The gateway accepts the token as either an Authorization: Bearer header or an x-api-key header, and serves the OpenAI Chat Completions and Responses APIs and the Anthropic Messages API.
Next steps
- Provider and model selection: control which models your agents can call
- Budgets: cap what your agents spend
- Monitoring and analysis: review your agents' inference calls