Saltar al cuntegna

Grok Imagine Reference to Video

Integrar

ID dal model xai/grok-imagine-video/reference-to-video
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://vit.doitong.com/api/v1/run/xai/grok-imagine-video/reference-to-video?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "images": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://vit.doitong.com/api/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Datotecas sco l'exempel: $0,402 402 credits API tias datotecas vegnan mesiradas avant l'execuziun Lantschar sin questa pagina

Obtegna ina clav API
xAI Referenza a video Inputs da referenza1–10 sfin a 720p #video-edit#v2v#grok#xai

Generescha video guidà da 1 fin a 7 maletgs da referenza marcads en il prompt sco @Image1, @Image2

xAI · Video

Tes emprim resultat vegn qua

Construis ina dumonda sutvart e l'exequescha cun tia clav API. Outputs vegnan copiads en nossa memorisaziun, conservads per adina u 7 dis gratuitamain.

Construir ina dumonda

Ils controls vegnan generads dal schema dal model. Il code e ​​il pretsch s'actualiseschan durant che ti als midas.

•obligatori 88 / 4096

Prompt da generaziun video cun referenzas d'maletgs ordinadas: @Image1 identifitgescha la prima entrada en reference_image_urls, @Image2 la segunda, e.u.v.

•obligatori reference_image_urls
Trametta in datoteca u · fin a 7

URLs da maletgs da referenza che furneschan directivas per stil e cuntengut dal video. Furnescha tranter 1 e 7 maletgs e referescha a quels en il prompt cun @Image1, @Image2, e.u.v.

resolution standard 480p

Resoluziun dal video d'output.

aspect_ratio standard 16:9

Relaziun d'aspect dal video final.

standard 8

Lunghezza dal video mesirada en secundas.

Avanzà enable_safety_checker
POST /run/xai/grok-imagine-video/reference-to-video?wait=20 calculaziun → $0,402
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://vit.doitong.com/api/v1/run/xai/grok-imagine-video/reference-to-video?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "images": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://vit.doitong.com/api/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

Executar questa dumonda

Tia clav resta en quest browser: ella vegn tramessa mo al Doitong API e memorisada (localStorage) mo sch'ella scheccas Tiar a memoria. Obtegnair ina clav API

Davart Grok Imagine Reference to Video

Crea ina sequenza d'in prompt da text plus 1 fin a 7 maletgs da referenza en `reference_image_urls`, che servan sco guid per stil e cuntegn. Menziuna els en il prompt sco @Image1, @Image2 e.u.v., en l'urden. La durada varia da 1 fin a 10 secundas (standard 8), la resoluziun è 480p u 720p, e plirs formats da 16:9 fin 9:16 èn disponibels.

Parameters

Invia u il num canonic u il num nativ, betg omaduas. Nums canonics

NumTip StandardPermess Descripziun
promptobligatori
Tipstring
≤ 4 096 caracters
Prompt da generaziun video cun referenzas d'maletgs ordinadas: @Image1 identifitgescha la prima entrada en reference_image_urls, @Image2 la segunda, e.u.v.
reference_image_urlsobligatori images
Tipurl[] · image
≤ 7 elements
URLs da maletgs da referenza che furneschan directivas per stil e cuntengut dal video. Furnescha tranter 1 e 7 maletgs e referescha a quels en il prompt cun @Image1, @Image2, e.u.v.
durationopziunal
Tipinteger
Standard8
1 – 10
Lunghezza dal video mesirada en secundas.
resolutionopziunal
Tipenum
Standard480p
480p720p
Resoluziun dal video d'output.
aspect_ratioopziunal
Tipenum
Standard16:9
16:94:33:21:12:33:49:16
Relaziun d'aspect dal video final.
enable_safety_checkeropziunal
Tipboolean
Standardtrue
La controlla po vegnir schluccada cun definir false, premess che l'appelant saja autorisà.
obligatori Num canonic, er acceptà

Ils parameters da datotecas acceptan ina URL publica https://, ina URI data: fin a 10 MB u il file_url d'ina chargiada. Datotecas

Output

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "xai/grok-imagine-video/reference-to-video",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 402,
    "usd": "0.402",
    "charged": 402,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
    "reference_image_urls": [
      "https://content.doitong.com/images/showcase/v3/gen_fox_cartoon.jpg"
    ]
  },
  "output": {
    "video": {
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_name": "0-output.mp4",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "fps": 1.0,
      "duration": 5,
      "num_frames": 1
    }
  },
  "outputs": [
    {
      "type": "video",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.mp4",
      "content_type": "video/mp4",
      "file_size": 1843200,
      "width": 1280,
      "height": 720,
      "duration": 5,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://vit.doitong.com/api/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://vit.doitong.com/api/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
Tias datotecas, tia decisiunMintga outputs[].url è ina copia en nossa memorisaziun: conservada per adina (pajà per GB-mes) u 7 dis gratuitamain, tenor la configuraziun dal conto u ?storage=.
La medema structura per mintga modeltype, url, content_type, width, height e duration, tant per maletgs sco per video e audio. output è l'object da resultat dal model sez.
Champs da l'output
video
object {url, content_type, file_name, file_size, width, height, fps, duration, num_frames}Video producì dal model.

Dapli models: Referenza a video

Per agents AI: questa pagina sco Markdown è disponibla sut https://doitong.com/rm/developers/models/xai/grok-imagine-video/reference-to-video.md. Tut ils models e las guidas: https://doitong.com/developers/llms.txt