Skip to main content
AGICTO API supports OpenAI-compatible request formats. You can reuse existing OpenAI SDK code and switch the Base URL, API Key, and model name.

Migration checklist

ItemOpenAIAGICTO API
Base URLhttps://api.openai.com/v1https://api.agicto.cn/v1
API KeyOpenAI API KeyAGICTO API Key
HeaderAuthorization: Bearer $API_KEYAuthorization: Bearer $API_KEY
Request formatOpenAI formatOpenAI-compatible format

Chat completions

curl https://api.agicto.cn/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
    "model": "gpt-4o",
    "messages": [
      {
        "role": "user",
        "content": "Summarize this text in three bullet points."
      }
    ]
  }'
Endpoint details: Chat completions

Embeddings

curl https://api.agicto.cn/v1/embeddings \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
    "model": "text-embedding-ada-002",
    "input": "AGICTO API supports OpenAI-compatible requests.",
    "encoding_format": "float"
  }'
Endpoint details: Create embeddings

Images

curl https://api.agicto.cn/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
    "model": "gpt-image-1",
    "prompt": "A clean product illustration for an API dashboard",
    "size": "1024x1024"
  }'
Endpoint details: Generate images

Common issues

  • If authentication fails, check Authorization: Bearer $API_KEY.
  • If the SDK calls the wrong URL, check whether your Base URL includes /v1.
  • If a model is unavailable, replace model with a model enabled for your account.
  • If a request body fails to parse, check whether the endpoint expects JSON or multipart/form-data.