Everything you need to integrate AI-Gate into your application. The API is OpenAI-compatible — swap the base URL and start using it immediately.
Authentication
All requests require an API key passed in the Authorization header as a Bearer token or via the standard Anthropic x-api-key header.
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://ai.kenechiifeanyi.com/v1/chat/completions
# Or with Anthropic / Claude extensions:
curl -H "x-api-key: YOUR_API_KEY" \
https://ai.kenechiifeanyi.com/v1/messages
You can request an API key from the landing page. Once submitted, an admin reviews the request and provisions the key. You will receive an email when the key is ready.
Chat Completions
The chat completions endpoint provides an OpenAI-compatible interface for sending messages and receiving AI-generated responses.
Endpoint
POST https://ai.kenechiifeanyi.com/v1/chat/completions
Request Format
{
"messages": [
{"role": "user", "content": "Hello, how are you?"}
],
"stream": true
}
Response Format
Default
Streaming is the default behavior. Responses are sent as application/x-ndjson over SSE.
The messages endpoint provides an Anthropic-compatible interface (/v1/messages) designed for Claude extensions, coding assistants, and tools like Cline, Roo Code, Continue, Claude Dev, and Cursor.
Endpoint
POST https://ai.kenechiifeanyi.com/v1/messages
Extension configuration
In your extension settings:
Provider: Anthropic
Base URL:https://ai.kenechiifeanyi.com (or https://ai.kenechiifeanyi.com/v1 depending on extension)
API key: Your AI-Gate key
Model: Enter any model name (e.g. claude-3-5-sonnet-20241022) or leave as default. AI-Gate routes requests through your configured multi-provider chat fallback chain.
Request format
{
"model": "claude-3-5-sonnet-20241022",
"max_tokens": 1024,
"system": "You are a helpful coding assistant.",
"messages": [
{
"role": "user",
"content": "Write a python function to compute fibonacci numbers."
}
],
"stream": true
}
Response format
Default
Full support for Anthropic SSE events (message_start, content_block_start, content_block_delta, content_block_stop, message_delta, message_stop).
The embeddings endpoint generates vector embeddings for input text. The model is determined automatically by the platform based on the embedding model synced via the admin dashboard.
Endpoint
POST https://ai.kenechiifeanyi.com/v1/embeddings
Request Format
{
"input": "This is the text to embed"
}
Pass an array of strings in input to embed multiple texts in a single request.
Process your documents through your own embedding step, store the vectors in your vector database, then use AI-Gate for chat completion calls that retrieve and reason over your context.
Image Generation
The image generation endpoint provides an OpenAI-compatible interface (/v1/images/generations) for creating high-fidelity images from text prompts using models like FLUX.1 Schnell, FLUX Realism, Seedream, and SDXL Turbo on Pollinations.
Endpoint
POST https://ai.kenechiifeanyi.com/v1/images/generations
Request Format
{
"prompt": "A futuristic cyberpunk city with neon reflections in rain",
"model": "flux",
"size": "1024x1024",
"n": 1,
"response_format": "url"
}
Parameters:
prompt(required): A text description of the desired image(s).
model(optional): The model to use (e.g. flux, flux-realism, seedream, turbo). Defaults to the highest-priority active image model.
size(optional): Image dimensions in WIDTHxHEIGHT format (e.g. 1024x1024, 1280x720, 768x1024). Defaults to 1024x1024.
n(optional): The number of images to generate (1 to 10). Defaults to 1.
response_format(optional): Either "url" (default) or "b64_json" for Base64-encoded image data.
async(optional): Set to true to dispatch to background Celery workers and immediately receive a task ID (HTTP 202) for status polling.
The video generation endpoint provides an API for generating dynamic video clips from text descriptions using models like Seedance Pro, Wan 2.1, and Google Veo.
Endpoint
POST https://ai.kenechiifeanyi.com/v1/videos/generations
Request Format
{
"prompt": "A cinematic timelapse of a sunset over rolling ocean waves",
"model": "seedance-pro",
"duration": 5,
"aspect_ratio": "16:9"
}
Parameters:
prompt(required): A detailed prompt describing the action, lighting, and camera motion for the video.
model(optional): The video model to use (e.g. seedance-pro, wan, veo). Defaults to the highest-priority active video model.
duration(optional): Duration of the generated clip in seconds (e.g. 4, 5, 6). Defaults to 5.
aspect_ratio(optional): Framing orientation (e.g. "16:9", "9:16", "1:1"). Defaults to "16:9".
async(optional): Set to true to execute via background Celery worker and receive an instant HTTP 202 Accepted response with a task ID to avoid long HTTP waiting states.
The audio generation endpoints provide an OpenAI-compatible speech synthesis interface (/v1/audio/speech and /v1/audio/generations) for creating spoken audio from text prompts using models like OpenAI Audio, TTS-1, and TTS-1-HD on Pollinations.
Endpoints
POST https://ai.kenechiifeanyi.com/v1/audio/speechPOST https://ai.kenechiifeanyi.com/v1/audio/generations
Request Format
{
"input": "AI-Gate provides multi-provider AI routing and automated fallbacks.",
"model": "openai-audio",
"voice": "nova",
"response_format": "mp3",
"speed": 1.0
}
Parameters:
input or prompt(required): The text to generate audio for (up to 4,096 characters).
model(optional): The audio model to use (e.g. openai-audio, tts-1, tts-1-hd). Defaults to the highest-priority active audio model.
voice(optional): The voice to use for narration (e.g. nova, alloy, echo, fable, onyx, shimmer). Defaults to nova.
response_format(optional): The audio format (e.g. mp3, wav, ogg, aac, flac). Defaults to mp3.
speed(optional): The speaking speed between 0.25 and 4.0. Defaults to 1.0.
async(optional): Set to true to dispatch synthesis to background Celery workers and immediately receive a task ID (HTTP 202) for status polling.
Image, audio, and especially video generation can take anywhere from a few seconds to a couple of minutes. To avoid keeping HTTP connections open and prevent gateway or proxy timeouts (such as Cloudflare 524 timeouts), you can offload jobs to our Celery background workers by setting "async": true.
1. Submit Asynchronous Generation Job
Add "async": true to your request body (or pass query parameter ?async=true):
curl -X POST https://ai.kenechiifeanyi.com/v1/videos/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A majestic eagle soaring over snow-capped mountains at sunset",
"model": "seedance-pro",
"async": true
}'
AI-Gate comes with built-in privacy protection. Sensitive information is automatically masked before being forwarded to upstream AI providers, preventing data leakage while preserving conversation context and reasoning quality.
What Gets Masked
API Keys & Tokens: Bearer tokens, OpenAI/OpenRouter keys (sk-...), GitHub tokens, AWS access keys, private keys, and JWTs are replaced with [API_KEY] or [JWT_TOKEN].
Passwords & Secrets: Passwords and credentials in config/JSON payloads are masked with [SECRET].
Email Addresses: Replaced with [EMAIL].
Credit Card Numbers: Replaced with [CREDIT_CARD].
Phone Numbers: Replaced with [PHONE_NUMBER].
IP Addresses: IPv4 addresses are replaced with [IP_ADDRESS].
Social Security Numbers: Replaced with [SSN].
Opt-out Parameter
Masking is enabled by default. If your workload requires sending unmasked raw data to the model, you can opt out by passing "masked": false in the request body.
{
"messages": [
{"role": "user", "content": "My contact is [email protected]"}
],
"masked": false
}
Limits
The following limits apply to all API requests to protect the gateway and ensure fair usage:
Request body size: 20 MB max
Chat messages per request: 128 max
Message content length: 200000 characters max
Embedding inputs per call: 100 max
Embedding input length: 200000 characters max
Rate limit: 60 requests per 15 minutes per API key
Requests exceeding any limit will receive an appropriate error response (413 for oversized bodies, 422 for invalid input, 429 for rate limiting).