POST
/
v1
/
chat
/
completions
curl -X POST "https://www.anyfast.ai/v1/chat/completions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "max_tokens": 1000,
    "messages": [
      {
        "role": "user",
        "content": "An astronaut golden retriever named Sora levitates around a space station"
      }
    ]
  }'

Create Video (Sora - Chat Format)

Create videos using Sora models through the chat completions API format. This allows for conversational video generation and iterative editing.

Endpoint

POST /v1/chat/completions

Request Parameters

ParameterTypeRequiredDescription
modelstringYessora-2 or sora-2-pro
messagesarrayYesChat messages array
max_tokensintegerNoMaximum tokens for response

Features

  • Text-to-Video: Generate videos from text descriptions
  • Image-to-Video: Generate videos from images using image_url content type
  • Iterative Editing: Continue conversations to modify generated videos
curl -X POST "https://www.anyfast.ai/v1/chat/completions" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sora-2",
    "max_tokens": 1000,
    "messages": [
      {
        "role": "user",
        "content": "An astronaut golden retriever named Sora levitates around a space station"
      }
    ]
  }'