APIKO
Getting Started

Quick Integration

Get started with APIKO APIs in minutes — image and text generation

Overview

Every APIKO API uses one base URL and one API Key. Text requests answer directly; image requests create tasks that you poll for the result.

SettingValue
Base URLhttps://api.apiko.app/v1
HeaderAuthorization: Bearer your-apiko-api-key
API KeyConsole → API Keys
BalanceNew accounts start with a zero balance. Top up in Console → Billing before your first request; otherwise calls return 403 insufficient_user_quota.
Model idsModels, or GET /v1/models with your key

Text API

Claude and GPT models use the OpenAI-compatible Chat Completions API, so the official OpenAI SDKs work with a changed base URL. Claude models also accept the Anthropic Messages API (see Claude).

python
from openai import OpenAI

client = OpenAI(
    api_key="your-apiko-api-key",
    base_url="https://api.apiko.app/v1",
)

response = client.chat.completions.create(
    model="claude-sonnet-5-5",
    messages=[{"role": "user", "content": "Hello, who are you?"}],
)
print(response.choices[0].message.content)

Image API

Send "async": true to POST /v1/images/generations. The response is a task; poll GET /v1/tasks/{id} until status is completed, then read data[0].url.

python
import time
import requests

BASE = "https://api.apiko.app/v1"
HEADERS = {"Authorization": "Bearer your-apiko-api-key"}

task = requests.post(f"{BASE}/images/generations", headers=HEADERS, json={
    "model": "gpt-image-2",
    "prompt": "A futuristic city at night, neon lights, cinematic",
    "size": "16:9",
    "async": True,
}).json()

while task["status"] not in ("completed", "failed"):
    time.sleep(5)
    task = requests.get(f"{BASE}/tasks/{task['id']}", headers=HEADERS).json()

print(task["data"][0]["url"] if task["status"] == "completed" else task.get("fail_reason"))

Async Task Workflow

Image tasks move through queued → in_progress → completed or failed. A request is charged when it is accepted, and a task that ends in failed is refunded in full.

Polling rules

  • Poll every 5–10 seconds; resubmitting does not speed a task up and creates a second charge.
  • Result links are APIKO-signed and kept for 24 hours. Download anything you need to keep.
  • Reference images (and masks, on models that accept them) must be public HTTPS URLs.
  • Each model's fields and allowed values are on its page in the API Manual.