Runway Creative Suite
Ámmátlaš govaid animeren Gen-2, Gen-3, ja Gen4 modeallaiguin. Cinema-kvalitehta bohtosat.
✓ Gen-2, Gen-3, Gen4 modeallat
✓ Govaid animeren
✓ Lihkastatstivren
✓ HD-kvalitehta
Duođašteapmi
Vai beasat Runway geavahit Doitong API bokte, de fertet geavahit iežat Doitong API-čoavdda. Bijat dan GraphQL-mutatšuvdnii dahje REST API-headerii.
// GraphQL Header
{
"Authorization": "Bearer YOUR_API_KEY"
}
// REST Header
"X-API-Key": "YOUR_API_KEY"
Jođánis álgu
Álge geavahit Runway Gen4 API moadde minuhtas. Čuovo dáid álkis lávkiid vai buvttadat iežat vuosttaš text to video.
1. lávki: Viečča API-čoavdda
Searvva Doitong-geavaheaddjin ja mana iežat dashboardii vai buvttadat API-čoavdda.
2. lávki: Daga vuosttaš goččuma
Geavat ovtta dáid kodaovdamearkkain vai dagat iežat vuosttaš API-goččuma.
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": "runway",
"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: 'runway',
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": "runway",
"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": "runway",
"input": {
"text": "A serene landscape with mountains and a lake at sunset"
},
"options": {
"duration": 5,
"aspectRatio": "16:9",
"version": "gen-4",
"quality": "high"
}
}
}
Hattit
Runway Gen4 API geavaha kredihtta-vuogádaga. Kredihtat gollat dan mielde man gáibideaddji ja guhkki buvttaduvvon sisdoallu lea.
| Doaibma | Kredihtat | Válddahus |
|---|---|---|
| Dábálaš vuohki | 100-200 Kredihtat | 5-10 sekundasaš video dábálaš kvalitehtas |
| Pro-vuohki | 300-500 Kredihtat | 5-10 sekundasaš video ámmátlaš kvalitehtas |
API-čujuhusat
Runway Gen4 API lea olámuttos min oktasaš GraphQL-čujuhusa bokte.
GraphQL-čujuhus
POST https://api.doitong.com/graphql
REST-čujuhus
POST https://api.doitong.com/v1/text_to_video
Parametarat
Olámuttos parametarat Runway Gen4 API-goččumiidda:
| Parametar | Tiipa | Bákkolaš | Válddahus |
|---|---|---|---|
service |
String | Yes | Bálvalus-identifikáhtor: "runway" |
prompt |
String | Yes | Teakstaválddahus das mii galgá buvttaduvvot |
duration |
Integer | No | Video bistin sekunddain (vuođđoárvu: 5) |
aspectRatio |
String | No | Govvahápmi: "16:9", "9:16", "1:1" (vuođđoárvu: "16:9") |
version |
String | No | Model version: "gen-2", "gen-3", "gen-4" |
webhookUrl |
String | No | URL gosa dieđut sáddejuvvojit go lea gárvvis |
Vástádushápmi
Buot API-vástádusat čuvvot seamma hámi:
Lihkostuvvan vástádus
{
"data": {
"generatevideo": {
"id": "abc123xyz",
"status": "processing",
"url": null,
"webhookUrl": "https://your-webhook.com/callback",
"createdAt": "2024-01-01T00:00:00Z"
}
}
}
Gárvves vástádus
{
"data": {
"generatevideo": {
"id": "abc123xyz",
"status": "completed",
"url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
"duration": 5,
"createdAt": "2024-01-01T00:00:00Z"
}
}
}
Meattáhusmeannudeapmi
API geavaha dábálaš HTTP-státuskodaid ja addá dárkilis meattáhussápmuiid.
Dábálaš meattáhuskodat
| Státuskoda | Meattáhustiipa | Válddahus |
|---|---|---|
| 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 |
Meattáhusvástádusa hápmi
{
"errors": [
{
"message": "Insufficient credits for this operation",
"extensions": {
"code": "INSUFFICIENT_CREDITS",
"creditsRequired": 100,
"creditsAvailable": 50
}
}
]
}
Webhooks
Vuostáiváldde dieđuid dakkaviđe go iežat text to video lea gárvvis.
Webhooks-konfigureren
Include a <code>webhookUrl</code> parameter in your request to receive a POST notification when processing is complete.
Webhook-data
{
"id": "abc123xyz",
"status": "completed",
"url": "https://cdn.doitong.com/outputs/abc123xyz.mp4",
"service": "runway",
"createdAt": "2024-01-01T00:00:00Z",
"completedAt": "2024-01-01T00:01:00Z",
"metadata": {
"duration": 5,
"width": 1920,
"height": 1080
}
}
Webhook-dorvolašvuohta
Buot webhook-goččumiin lea signatuvra-header duođašteami várás:
X-Doitong-Signature: sha256=abc123...
Geavahanrájit
Vai sihkkarastit dásseis geavaheami ja vuogádaga stabilitehta, de čuvvovaš rájit leat fámus:
| Plána | Goččumat/Minuhta | Simultána barggut | Beaivválaš rádji |
|---|---|---|---|
| Nuvttá | 10 | 1 | 100 |
| Starter | 30 | 3 | 1,000 |
| Pro | 60 | 10 | 10,000 |
| Enterprise | Heivehuvvon | Heivehuvvon | Rájiheapme |
X-RateLimit-Limit: Maximum requests per windowX-RateLimit-Remaining: Requests remainingX-RateLimit-Reset: Window reset timestamp
Buoremus vuogit
1. Optimeret iežat proavttaid
Čále čielga ja válddaheaddji proavttaid vai oaččut buoremus bohtosiid:
- Be specific about visual elements, style, and mood
- Include details about lighting, camera angles, and composition
- Avoid contradictory or impossible requests
2. Meannut asynkronalaš proseassaid
Buvttadeapmi lea asynkronalaš. Geavat polling-vuogádaga dahje webhooks:
// 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. Meattáhusmeannudeapmi
Geavat retry-logihka mii lassána dásset (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. Čuovo kredihttageavaheami
Čuovo iežat kredihtaid vai bálvalus ii botkejuvvo:
- Check credit balance before large batch operations
- Set up alerts for low credit thresholds
- Implement credit-aware request queuing
Leatgo gárvvis álgit?
Searvva duhátnaraidda ovddideaddjiide geat geavahit Runway Gen4 API buvttadan dihte eami sisdoalu