---
agent:
  instructions: "Search the site by keyword or question. The search API returns Markdown."
  endpoint: "https://platform.invideo.io/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# xAI

> Generate video with xAI’s API format and images with OpenAI’s API format through Platform.

Base URL:

```text
https://platform-api.invideo.io/xai
```


Use `jq` to read the request ID from the submit response.

```bash
REQUEST_ID=$(curl -fsS -X POST https://platform-api.invideo.io/xai/v1/videos/generations \
  -H "Authorization: Bearer $INVIDEO_API_KEY" -H "Content-Type: application/json" \
  -d '{"model": "veo-3-fast", "prompt": "A red fox running through snow", "duration": 4}' | jq -er .request_id)

curl "https://platform-api.invideo.io/xai/v1/videos/$REQUEST_ID" -H "Authorization: Bearer $INVIDEO_API_KEY"
# {"status": "done", "video": {"url": "..."}}
```

`status` is `pending`, `done` or `failed`. Images use the [OpenAI shape](/docs/sdks/openai-media) at `/xai/v1/images/generations`. Use a Platform video or image model that matches the endpoint.
