API Reference
Endpoint reference
Use these endpoints to build against the APIAny gateway. Core routes follow OpenAI-compatible conventions, while compatibility routes preserve old clients from the previous API platform.
Authentication
Protected endpoints accept Authorization: Bearer sk-your-api-key. During migration, x-api-key is also accepted, and Gemini-compatible routes accept x-goog-api-key.
Authenticated request
curl https://devnextapiany.mexxxxai.win/api/v1/models \
-H "Authorization: Bearer sk-your-api-key"Endpoints
| GET | /api/v1/models | List active public models with type, capability, pricing, and parameters. |
| POST | /api/v1/chat/completions | Send OpenAI-compatible chat completion requests. |
| POST | /api/v1/images/upload | Upload JPEG, PNG, or WebP inputs with API key authentication. |
| POST | /api/v1/images/generate | Create an async image generation task. |
| POST | /api/v1/video/generate | Create an async video generation task. |
| GET | /api/v1/tasks/{task_id} | Poll an async media task by task id. |
| POST | /api/v1/api/generate | Accepts legacy media fields such as images, aspectRatio, imageSize, and video model aliases. |
| GET | /api/v1/api/result?id={task_id} | Legacy task result alias for clients using id as the query parameter. |
| GET | /api/v1/video/status?task_id={task_id} | Legacy video status response with success/data wrapper. |
| GET | /api/v1/internal/workflow-status?uuid={task_id} | Legacy workflow status alias for clients polling image task uuid values. |
| POST | /api/v1beta/models/{model}:generateContent | Accepts Gemini contents and generationConfig, then routes through the platform pipeline. |
| POST | /api/internal/jobs/process-pending-callbacks | Internal scheduler endpoint that retries pending async task callbacks. |
| POST | /api/internal/jobs/check-stale-media-tasks | Internal scheduler endpoint that marks stale processing media tasks failed and refunds reserved credits. |
| POST | /api/internal/jobs/check-api-channels | Internal scheduler endpoint that checks upstream channel health and updates routing status. |
| POST | /api/internal/jobs/scheduled-maintenance | Internal scheduler endpoint that rebuilds monthly summaries and deletes expired API detail rows. |
| GET | /api/internal/jobs/scheduled-maintenance | Returns recent scheduled-maintenance and retention cleanup runs. |
Examples
Chat completion
curl https://devnextapiany.mexxxxai.win/api/v1/chat/completions \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"messages": [
{ "role": "user", "content": "Write a concise release note." }
],
"max_tokens": 180
}'Media compatibility
curl https://devnextapiany.mexxxxai.win/api/v1/api/generate \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "videoai-3.1-fast",
"type": "video",
"prompt": "A product API network map, clean and cinematic",
"aspectRatio": "16:9"
}'Gemini compatibility
curl https://devnextapiany.mexxxxai.win/api/v1beta/models/gpt-5.5:generateContent \
-H "x-goog-api-key: sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{ "role": "user", "parts": [{ "text": "Explain API credit budgets." }] }
],
"generationConfig": {
"maxOutputTokens": 180
}
}'Compatibility notes
- API keys are hashed at rest and can be scoped by project, model allowlist, RPM, and credit budget.
- Channels are selected by model channel groups, priority, and weight. Failed upstream attempts are recorded and retried on the next eligible channel for transient errors.
- Run the channel health job from a scheduler to keep failover decisions fresh.
- Run scheduled-maintenance daily to keep monthly revenue and cost rollups available and delete expired API detail rows after the retention window.
- Media endpoints return task_id immediately; process pending media tasks from your scheduler and poll the task endpoint for completion.
- Async media requests may include callback_url. It must be a public HTTPS URL; delivery failures are retried and do not change the task status.
- Gemini-compatible streamGenerateContent requests are normalized through the non-streaming pipeline until streaming settlement is added.
