Support QQ group1098515135

Documentation

Runnable examples for API access, image generation, async tasks and common errors.

Quick start

Create a key, replace the Base URL and call with any OpenAI-compatible client.

Create a project key

Use one key per project, keep it on the server and never put it in web pages or public repos.

Manage keys

Base URL

https://api.latticehub.cc/v1

OpenAI SDKs usually need the /v1 suffix. Use the full address shown here for direct requests too.

curl https://api.latticehub.cc/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_MODEL",
    "messages": [{"role": "user", "content": "ping"}]
  }'
curl https://api.latticehub.cc/v1/models \
  -H "Authorization: Bearer YOUR_API_KEY"

Image generation and editing

Use the OpenAI Images compatible API. Read data[0].url first; if b64_json is returned, decode and save it.

curl https://api.latticehub.cc/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "YOUR_IMAGE_MODEL",
    "prompt": "A clean product photo on a dark stone surface",
    "size": "1024x1024"
  }'

Async tasks

Slow jobs such as video are submitted first and polled later: you get a task_id, check its status, then read the result. Submitted tasks also appear under "Async tasks" in the console.

# 1. Submit
curl https://api.latticehub.cc/v1/video/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "YOUR_VIDEO_MODEL", "prompt": "A paper boat drifting on a pond"}'

# 2. Poll (task_id comes from step 1)
curl https://api.latticehub.cc/v1/video/generations/TASK_ID \
  -H "Authorization: Bearer YOUR_API_KEY"

Common errors

  • 401: the key is invalid, deleted or mistyped. Copy it again.
  • 403: the key group cannot call this model, or the IP allow-list rejected the request.
  • 429: too many requests. Lower concurrency and retry.
  • Insufficient quota: top up or raise the key quota limit.
  • Model temporarily unavailable: try again later, or use a key in another group.