One provider per protocol
Claude models answer natively on Anthropic Messages, keeping extended thinking and prompt caching intact. Every other catalog model works on OpenAI chat. Point each provider at the base URL its protocol expects.
pi coding agent
pi reads custom providers from ~/.pi/agent/models.json. Aiduct speaks every API pi supports, so each model can use the protocol that suits it best.
{
"providers": {
"aiduct": {
"baseUrl": "https://api.aiduct.ai/v1",
"api": "openai-completions",
"apiKey": "$AIDUCT_API_KEY",
"models": [{ "id": "deepseek-v4.1-flash" }, { "id": "glm-5.3" }]
},
"aiduct-claude": {
"baseUrl": "https://api.aiduct.ai",
"api": "anthropic-messages",
"apiKey": "$AIDUCT_API_KEY",
"models": [{ "id": "claude-sonnet-5", "input": ["text", "image"] }]
}
}
}CONFIG
models.json
PROTOCOL
Messages + Chat
BILLING
Published pricing
Claude models answer natively on Anthropic Messages, keeping extended thinking and prompt caching intact. Every other catalog model works on OpenAI chat. Point each provider at the base URL its protocol expects.
pi expands $AIDUCT_API_KEY from the environment when it sends a request, so models.json holds no secret.
FAQ
openai-completions and openai-responses use https://api.aiduct.ai/v1. anthropic-messages and google-generative-ai use https://api.aiduct.ai, because their SDKs add the version path themselves.
Yes. Add a provider with the google-generative-ai API and the gateway root, or reach any Gemini model through openai-completions.
Yes. pi's levels from off to max map onto each model's own reasoning controls, and a level a model lacks rounds up to the nearest one it has.