Skip to main content

1. Create an API key

Open the APIAny.AI dashboard and create a project API key.

2. List available models

curl https://api.apiany.ai/v1/models \
  -H "Authorization: Bearer $APIANY_API_KEY"

3. Run a chat completion

curl https://api.apiany.ai/v1/chat/completions \
  -H "Authorization: Bearer $APIANY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.4",
    "messages": [
      { "role": "user", "content": "Write a concise product tagline for APIAny.AI." }
    ]
  }'

4. Create an image task

curl https://api.apiany.ai/v1/images/generations \
  -H "Authorization: Bearer $APIANY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "nano-banana",
    "prompt": "A clean product hero image for an AI API gateway",
    "size": "1k"
  }'
The response includes a task_id. Poll the task until it completes:
curl https://api.apiany.ai/v1/tasks/task_123 \
  -H "Authorization: Bearer $APIANY_API_KEY"

Local development note

When testing against the local Next.js app, use:
http://localhost:3000/api/v1/...