AI Gateway Quickstart
Connect Apinizer to at least one LLM provider — cloud (OpenAI, Anthropic, Azure, Vertex, Bedrock) or self-hosted (vLLM, Ollama, Hugging Face TGI). The connection stores the provider's credentials encrypted, so your application never handles the real key.
See LLM Providers and Connections for the full setup steps.
Configure the OpenAI SDK (or any OpenAI-compatible client) with your gateway's base_url and your Apinizer credential key:
from openai import OpenAI
client = OpenAI(
api_key="your-apinizer-credential-key",
base_url="https://your-apinizer-gateway.com/api/ai/v1"
)
No other client-side changes are needed — the SDK talks to Apinizer exactly as it would talk to OpenAI directly.
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Hello, Apinizer!"}],
stream=True
)
for chunk in response:
if chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
The response streams back chunk-by-chunk as it arrives from the provider — the same shape you'd get calling the provider directly, regardless of which provider actually served the request.
Next Steps
See the full request pipeline and feature set
Configure additional providers and deployment types
Browse bundled models and pricing
Add backup providers and failover strategies
Cap usage before you go to production