Developer API

Every model, one API key.

One API key connects Claude, ChatGPT, Grok, Gemini and Perplexity — no separate keys, integrations, or billing to juggle for each provider. Take the prompts you've already tested on the web and drop them straight into your app, script, or automation. Exact model availability and request limits depend on your plan.

One key. Every model.

Use this API to connect your application to models available to your account. Configure the Base URL and key in a compatible OpenAI client, choose a model ID from the live catalog and start with a small request. Keep keys on your server and review usage, permissions and limits in your account.

Base URL
https://aifiesta-api.dev.codexcape.solutions/v1
Auth header
Authorization: Bearer af_YOUR_API_KEY
Rate limit
60 requests / minute per key

Quick start

Start with the curl or OpenAI SDK example below. Replace the Base URL, key and model ID, check the response, then add streaming, timeouts and error handling as needed.

bash
curl https://aifiesta-api.dev.codexcape.solutions/v1/chat/completions \
  -H "Authorization: Bearer af_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "claude-sonnet-5",
    "messages": [{"role": "user", "content": "Say hello in five words."}]
  }'
python
from openai import OpenAI

client = OpenAI(base_url="https://aifiesta-api.dev.codexcape.solutions/v1", api_key="af_YOUR_API_KEY")

resp = client.chat.completions.create(
    model="claude-sonnet-5",
    messages=[{"role": "user", "content": "Say hello in five words."}],
    stream=True,
)
for chunk in resp:
    print(chunk.choices[0].delta.content or "", end="")
javascript
import OpenAI from "openai";

const client = new OpenAI({ baseURL: "https://aifiesta-api.dev.codexcape.solutions/v1", apiKey: "af_YOUR_API_KEY" });

const res = await client.chat.completions.create({
  model: "claude-sonnet-5",
  messages: [{ role: "user", content: "Say hello in five words." }],
});
console.log(res.choices[0].message.content);
console.log(res.aifiesta); // { points_charged, points_balance, upstream_model }

What comes back

Standard OpenAI chat.completion objects, plus an aifiesta block with the points charged for the call and your remaining balance. With stream: true you get chat.completion.chunk frames and a final data: [DONE].

Send images as image_url content parts (https or data URLs). Set max_tokens and temperature as usual; we translate vendor quirks for you.

Endpoints

All paths are relative to the base URL and require your key.

GET/modelslive catalog

Returns every model available to you with type (chat / image / video), points_per_request and context window.

POST/chat/completions

OpenAI chat schema. Body: model, messages, optional stream, max_tokens, temperature. Cost: the model's points, charged only on success.

POST/images/generations

Synchronous. Body: model, prompt, optional n (1–4), aspect_ratio (e.g. 16:9) or OpenAI size, optional image_url reference for edits. Returns hosted URLs. Failed images are refunded.

bash
curl https://aifiesta-api.dev.codexcape.solutions/v1/images/generations \
  -H "Authorization: Bearer af_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "gemini-flash-image", "prompt": "a paper boat on a puddle after rain", "aspect_ratio": "16:9"}'
POST/videos/generationsasync

Returns 202 with a job id; poll GET /videos/generations/{id} every few seconds until status is completed (then url is set) or failed (points refunded). Body: model, prompt, aspect_ratio, duration seconds, optional image_url first frame.

bash
curl https://aifiesta-api.dev.codexcape.solutions/v1/videos/generations \
  -H "Authorization: Bearer af_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "veo-3-1", "prompt": "slow dolly through a misty pine forest at dawn", "aspect_ratio": "16:9", "duration": 6}'

# then
curl https://aifiesta-api.dev.codexcape.solutions/v1/videos/generations/JOB_ID -H "Authorization: Bearer af_YOUR_API_KEY"
GET/usage

Requests and points spent by this key, your current balance and the most recent calls.

Models & prices

Live from the catalog — what you see here is what the API accepts as `model`.

Errors & limits

  • 401 invalid_api_key — missing, wrong or revoked key.
  • 402 insufficient_points — top up or redeem a code, then retry.
  • 403 model_not_allowed / api_key_disabled / api_access_disabled — an administrator has restricted this model, key or account; contact support.
  • 404 not_found — unknown model; check GET /models.
  • 429 rate_limited — 60 requests per minute per key; back off for details.retry_after seconds.
  • 429 quota_exceeded — an admin-set daily request or monthly points cap for your account was reached; GET /usage shows the limits under quota.
  • 502 provider_error / 503 model_unavailable — upstream trouble after our retries and fallbacks; nothing was charged.

Error bodies are OpenAI-shaped: {"error": {"message", "type", "code"}}.

Need something the API does not cover yet? Contact support from your account.

API documentation · AI 雲