Google Veo3 Ultra

Model cynhyrchu fideo diweddaraf Google gyda realaeth anhygoel a chywirdeb ffisegol.

✓ Fideo ultra-realistig

✓ Cywirdeb ffisegol

✓ Cydraniad uchel

✓ Cynhyrchu cyflym

Dilysu

I gael mynediad i Google Veo3 drwy API Doitong, defnyddiwch eich allwedd API Doitong. Cynhwyswch hi ym mhennynnau'r mwtaniad GraphQL neu'r REST API.

Pwysig: Cadwch eich allwedd API Doitong yn ddiogel a pheidiwch byth â'i datgelu mewn cod ochr-cleient. Gwnewch alwadau API o'ch gweinydd cefn bob amser.
// GraphQL Header
{
  "Authorization": "Bearer YOUR_API_KEY"
}

// REST Header
"X-API-Key": "YOUR_API_KEY"

Cychwyn Cyflym

Dechreuwch ddefnyddio Veo-3 API mewn ychydig funudau yn unig. Dilynwch y camau syml hyn i gynhyrchu eich text to video cyntaf.

Cam 1: Cael eich Allwedd API

Cofrestrwch am gyfrif Doitong ac ewch i'ch dangosfwrdd i gynhyrchu allwedd API.

Cam 2: Gwneud eich Cais Cyntaf

Defnyddiwch un o'r enghreifftiau cod isod i wneud eich galwad API gyntaf.

curl -X POST https://api.doitong.com/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: unique-request-id-123" \
  -d '{
    "query": "mutation Generate($input: GenerateInput!) { generate(input: $input) { id status type provider url metadata creditCost } }",
    "variables": {
      "input": {
        "type": "VIDEO",
        "provider": "veo3",
        "input": {
          "text": "A serene landscape with mountains and a lake at sunset"
        },
        "options": {
          "duration": 5,
          "aspectRatio": "16:9"
        }
      }
    }
  }'
const response = await fetch('https://api.doitong.com/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY',
    'Idempotency-Key': 'unique-request-id-123'
  },
  body: JSON.stringify({
    query: `
      mutation Generate($input: GenerateInput!) {
        generate(input: $input) {
          id
          status
          type
          provider
          url
          metadata
          creditCost
        }
      }
    `,
    variables: {
      input: {
        type: 'VIDEO',
        provider: 'veo3',
        input: {
          text: 'A serene landscape with mountains and a lake at sunset'
        },
        options: {
          duration: 5,
          aspectRatio: '16:9'
        }
      }
    }
  })
});

const data = await response.json();
console.log('Result:', data.data.generate);
import requests
import json

url = "https://api.doitong.com/graphql"
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
}

query = """
mutation Generate($input: GenerateInput!) {
  generate(input: $input) {
    id
    status
    type
    provider
    url
    metadata
    creditCost
  }
}
"""

variables = {
    "input": {
        "type": "VIDEO",
        "provider": "veo3",
        "input": {
            "text": "A serene landscape with mountains and a lake at sunset"
        },
        "options": {
            "duration": 5,
            "aspectRatio": "16:9"
        }
    }
}

response = requests.post(url, json={
    "query": query,
    "variables": variables
}, headers=headers)

data = response.json()
print("Result:", data["data"]["generate"])
mutation Generate($input: GenerateInput!) {
  generate(input: $input) {
    id
    status
    type
    provider
    url
    metadata
    creditCost
    createdAt
  }
}

# Variables
{
  "input": {
    "type": "VIDEO",
    "provider": "veo3",
    "input": {
      "text": "A serene landscape with mountains and a lake at sunset"
    },
    "options": {
      "duration": 5,
      "aspectRatio": "16:9",
      "version": "veo-3",
      "quality": "high"
    }
  }
}

Prisio

Mae Veo-3 API yn defnyddio model prisio sy'n seiliedig ar gredydau. Defnyddir credydau yn ôl cymhlethdod a hyd y cynnwys a gynhyrchir.

Nodwedd Credydau Disgrifiad
Modd Safonol 100-200 Credydau Fideo 5-10 eiliad o ansawdd safonol
Modd Pro 300-500 Credydau Fideo 5-10 eiliad o ansawdd proffesiynol

Pwyntiau Terfyn API

Mae Veo-3 API ar gael drwy ein pwynt terfyn GraphQL unedig.

Pwynt Terfyn GraphQL

POST https://api.doitong.com/graphql

Pwynt Terfyn REST

POST https://api.doitong.com/v1/text_to_video

Paramedrau

Paramedrau sydd ar gael ar gyfer ceisiadau Veo-3 API:

Paramedr Math Gofynnol Disgrifiad
service Llinyn Yes Dynodwr gwasanaeth: "veo3"
prompt Llinyn Yes Disgrifiad testun o beth i'w gynhyrchu
duration Cyfanrif No Hyd y fideo mewn eiliadau (rhagosodiad: 5)
aspectRatio Llinyn No Cymhareb agwedd: "16:9", "9:16", "1:1" (rhagosodiad: "16:9")
version Llinyn No Model version: "veo-3"
webhookUrl Llinyn No URL i dderbyn hysbysiadau cwblhau

Fformat yr Ymateb

Mae holl ymatebion yr API yn dilyn fformat cyson:

Ymateb Llwyddiannus

{
  "data": {
    "generatevideo": {
      "id": "abc123xyz",
      "status": "processing",
      "url": null,
      "webhookUrl": "https://your-webhook.com/callback",
      "createdAt": "2024-01-01T00:00:00Z"
    }
  }
}

Ymateb Wedi'i Gwblhau

{
  "data": {
    "generatevideo": {
      "id": "abc123xyz",
      "status": "completed",
      "url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
      "duration": 5,
      "createdAt": "2024-01-01T00:00:00Z"
    }
  }
}

Trin Gwallau

Mae'r API yn defnyddio codau statws HTTP safonol ac yn dychwelyd negeseuon gwall manwl.

Codau Gwall Cyffredin

Cod Statws Math o Wall Disgrifiad
400 Bad Request Invalid parameters or malformed request
401 Unauthorized Missing or invalid API key
402 Payment Required Insufficient credits
429 Too Many Requests Rate limit exceeded
500 Internal Server Error Server error, please retry

Fformat Ymateb Gwall

{
  "errors": [
    {
      "message": "Insufficient credits for this operation",
      "extensions": {
        "code": "INSUFFICIENT_CREDITS",
        "creditsRequired": 100,
        "creditsAvailable": 50
      }
    }
  ]
}

Webhooks

Derbyniwch hysbysiadau amser-real pan fydd eich text to video wedi'i gynhyrchu.

Ffurfweddu Webhooks

Include a <code>webhookUrl</code> parameter in your request to receive a POST notification when processing is complete.

Llwyth Cyflog Webhook

{
  "id": "abc123xyz",
  "status": "completed",
  "url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
  "service": "veo3",
  "createdAt": "2024-01-01T00:00:00Z",
  "completedAt": "2024-01-01T00:01:00Z",
  "metadata": {
    "duration": 5,
    "width": 1920,
    "height": 1080
  }
}

Diogelwch Webhook

Mae pob cais webhook yn cynnwys pennyn llofnod ar gyfer dilysu:

X-Doitong-Signature: sha256=abc123...

Terfynau Cyfradd

Er mwyn sicrhau defnydd teg a sefydlogrwydd y system, mae'r terfynau cyfradd canlynol yn berthnasol:

Cynllun Ceisiadau/Munud Tasgau Cydredol Terfyn Dyddiol
Am Ddim 10 1 100
Dechreuwr 30 3 1,000
Pro 60 10 10,000
Menter Personol Personol Diderfyn
Pennynnau Terfyn Cyfradd: Gwiriwch bennynnau'r ymateb am statws y terfyn cyfredol:
  • X-RateLimit-Limit: Maximum requests per window
  • X-RateLimit-Remaining: Requests remaining
  • X-RateLimit-Reset: Window reset timestamp

Arferion Gorau

1. Optimeiddio eich Anogwyr

Ysgrifennwch anogwyr clir a disgrifiadol i gael y canlyniadau gorau:

  • Be specific about visual elements, style, and mood
  • Include details about lighting, camera angles, and composition
  • Avoid contradictory or impossible requests

2. Trin Prosesu Anghydamserol

Mae'r broses gynhyrchu yn anghydamserol. Gweithredwch brosesau 'polling' neu webhooks priodol:

// Polling example
async function pollStatus(jobId) {
  let status = 'processing';
  while (status === 'processing') {
    await sleep(2000); // Wait 2 seconds
    const result = await checkJobStatus(jobId);
    status = result.status;
  }
  return result;
}

3. Adfer o Wallau

Gweithredwch resymeg ailgeisio gydag egwyl esbonyddol (exponential backoff):

async function retryWithBackoff(fn, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      return await fn();
    } catch (error) {
      if (i === maxRetries - 1) throw error;
      await sleep(Math.pow(2, i) * 1000);
    }
  }
}

4. Monitro Defnydd Credydau

Traciwch eich defnydd o gredydau er mwyn osgoi toriadau yn y gwasanaeth:

  • Check credit balance before large batch operations
  • Set up alerts for low credit thresholds
  • Implement credit-aware request queuing

Yn barod i ddechrau?

Ymunwch â miloedd o ddatblygwyr sy'n defnyddio Veo-3 API i greu cynnwys anhygoel

Cael Allwedd API Nawr Gweld y Prisiau