User Guide

Quick Start

Complete your first text, image, and video request with Magick API

Magick API Official Developer Documentation

Welcome to Magick API. This page, based on the organized source documentation, provides the shortest integration path to help you complete your first call.

Tip: You only need to replace the domain and API KEY with Magick API's to migrate seamlessly with zero code changes!

Step 1: Obtain an API Key

  1. Open the API Key Management page.
  2. Log in to your account and create a new API Key.
  3. Keep the key secure. Pass it in subsequent calls via Authorization: Bearer YOUR_API_KEY.

Step 2: Choose an Interface Type

Text and most image interfaces typically return results synchronously; video interfaces use an asynchronous task model, returning id / task_id upon successful submission.

Step 3: Send a Request

Text Generation Example

curl -X POST https://api.magickapi.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5",
    "messages": [
      {
        "role": "user",
        "content": "帮我调查并推荐一个最适合编码的大模型"
      }
    ]
  }'

Image Generation Example

curl -X POST https://api.magickapi.com/v1/images/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "可爱的猫咪坐在劳斯莱斯后座上哭",
    "size": "1:1",
    "n": 1
  }'

Video Generation Example

curl -X POST https://api.magickapi.com/v1/videos \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "veo-3.1-fast-generate-preview",
    "prompt": "一个小女孩坐在窗台欣赏春风吹动的柳树",
    "duration": 8,
    "size": "1280x720"
  }'

Step 4: Query Task Status

After the video interface returns id / task_id, poll it through the OpenAI-compatible video task endpoint:

curl -X GET https://api.magickapi.com/v1/videos/YOUR_TASK_ID \
  -H "Authorization: Bearer YOUR_API_KEY"

After the task is completed, download the video content:

curl -L https://api.magickapi.com/v1/videos/YOUR_TASK_ID/content \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --output output.mp4

It is recommended to wait 5 to 10 seconds after submission before starting to poll, then query every 3 to 5 seconds.

Next Steps

Last updated on

On this page