세대 작업 만들기Create a generation task
세대 작업을 제출 - 크레딧은 확인하고 앞에 예약.
POST/api/v1/generations
작업을 제출하고 즉시 반환합니다. 크레딧은 미리 확인되고 예약됩니다. 응답은 정확한 금액을 알려줍니다.
미디어 입력의 경우 자신의 미디어 URL을 전달하거나 사용하십시오. asset:<asset_id>업로드 응답의 ID로. public_visibility작품을 게시할 것인지 여부를 나타냅니다. 작업은 모든 결과가 검토를 통과 한 후에 만 공개 될 수 있으며 게시 요구 사항을 충족합니다.
요청 본문
| 필드 | 타입 | 설명 |
|---|---|---|
model | string· 필수 | 합성 모형 id from GET /api/v1/models예를 들어, "text-to-image:c9vuwv34uj9w". |
input | object· 필수 | 모델 매개 변수, 모델당 키링 params 목록 — 목록이 없는 키는 다음과 같이 거부됩니다. invalid_request (param 이름을 붙인다). 거의 모든 모델이 prompt. 이미지, 비디오 및 오디오 필드는이 서비스에 저장된 파일의 URL을 가져옵니다. 먼저 업로드하십시오. POST /api/v1/uploads, 또는 이전 작업의 출력 URL을 재사용 (GET /api/v1/uploads 두 가지 목록 모두); 다른 URL은 거부됩니다. media_not_uploaded. |
callback_url | string | HTTPS 엔드포인트는 터미널 상태에 도달할 때 작업을 게시합니다. 개인 또는 내부 주소를 가리키면 안됩니다. |
curl https://vidocraft.com/api/v1/generations \
-X POST \
-H "Authorization: Bearer sk_test_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"model": "text-to-image:c9vuwv34uj9w",
"callback_url": "https://your-app.com/api/hooks/generation",
"input": {
"prompt": "a lighthouse on a cliff at golden hour, cinematic",
"aspect_ratio": "16:9"
}
}'응답
{
"taskId": "3f2ak9mr7xqp4tnz8blc6ywh",
"credits": 1
}credits이 작업을 위해 예약된 금액입니다. 테스트 키 추가 반환 sandbox: true.
-
Group images (
max_images). Some image models take amax_imagescap instead of a fixed count: the model returns as many images as the prompt asks for, up to the cap — so state the number in the prompt ("3 images of …"). Credits are reserved for the cap; when the task succeeds, the charge is settled to the images actually returned and the rest is refunded, so the task'screditsshows the final amount. Some models cap reference images andmax_imagestogether —GET /api/v1/modelsshows it assharedLimiton that parameter (e.g."with": "image_input", "total": 15), and a request over it is refused withinvalid_request. -
Prompts pass server-side content moderation; refused prompts return(프롬프는 서버 측 콘텐츠 중재를 통과한다.
moderation_blocked. 따라서 업로드 대신 승인 된 도메인에서 연결된 이미지와 비디오를 수행하십시오. -
스토리지 할당량 집행이 활성화되면 현재 사용량이 계정 할당량을 초과하는 경우
403 storage_quota_exceeded로 새 라이브 작업이 거부됩니다. 그 거절에 대해 크레딧이 청구되지 않습니다. 할당량에서 정확히 사용이 허용됩니다. 이미 허용된 작업은 계속되며 나중에 사용량이 할당량을 초과하더라도 결과가 저장됩니다. 테스트 키는 시뮬레이션된 샌드박스 동작을 유지합니다. -
이미지 및 비디오 결과도 조정됩니다. 플래그가 지정된 결과가 보류됨: 작업이 종료됩니다.
failedwithfailed_reason: nsfw_output_blocked, 그리고 크레딧은 환불되지 않습니다 (billing_status: charged). -
프리미엄 모델 및 모든 옵션 또는 param 플래그
available: false/premium: true에서GET /api/v1/models, 활성 구독이 필요합니다. 그렇지 않으면 요청이 실패합니다.403 forbidden, 그리고 옵션 또는 param의 경우 오류param이름을 붙인다. 이러한 파라미를 꺼내는 것은 괜찮습니다. 계정에 나열된 기본값이 필요합니다. -
Publication intent is public by default; 가입한 계정은 설정하여 비공개로 유지할 수 있습니다.
public_visibility: false. 무료 계정은 해당 의도를 변경할 수 없습니다. 승인되지 않은 파일은 여전히 비공개로 유지됩니다. 공개 결과는 커뮤니티 갤러리에 소개 될 수 있습니다. -
복사 보호는 기본적으로 꺼져 있습니다. 구독 한 계정은 설정할 수 있습니다.
copy_protection: true프롬프트 및 업로드 된 미디어가 커뮤니티에 표시되지 않도록합니다.