{{docs.790d883ad1}}
- {{docs.70589413a3}}
{{docs.f48aafb884}}- {{docs.connectionAuth}}
{{docs.a33af39752}}<{{docs.358b5f6606}}>- {{docs.connectionEndpoints}}
/chat/completions/responses/models/images/generations/images/edits
{{docs.fc0fb94ff7}}
{{docs.1d7af122d6}}
{{docs.getStarted}}
{{docs.commonLead}}
{{docs.e13c8f76c2}}<YOUR_API_KEY>{{docs.1509149247}}
{{docs.w408ConnectEpIntro}}
| {{docs.w408EpFormat}} | {{docs.70589413a3}} | {{docs.connectionAuth}} |
|---|---|---|
| {{docs.790d883ad1}} | {{docs.f48aafb884}} | {{docs.a33af39752}}<{{docs.358b5f6606}}> |
| {{docs.3d0b6b862c}} | {{docs.16090be1a2}} | {{docs.55442fea7e}}<{{docs.358b5f6606}}> |
| Gemini | https://api.edgeweigh.com | x-goog-api-key: <YOUR_API_KEY> |
| {{docs.seedanceArk}} | https://api.edgeweigh.com/v1 | Authorization: Bearer <YOUR_API_KEY> |
| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /v1/chat/completions | {{docs.w408EpOpenaiPurpose}} |
POST /v1/responses | {{docs.w664EpResponses}} |
GET /v1/models | {{docs.w664EpModels}} |
POST /v1/images/generations{{docs.w664EpImagesSep}}/v1/images/edits | {{docs.w664EpImages}} |
POST /v1/messages | {{docs.w408EpAnthropicPurpose}} |
POST /v1beta/models/{model}:generateContent | {{docs.w408EpGeminiPurpose}} |
POST /v1/contents/generations/tasks | {{docs.w408EpArkPurpose}} |
POST /v1/videos | {{docs.w664EpVideos}} |
{{docs.f48aafb884}}{{docs.a33af39752}}<{{docs.358b5f6606}}>/chat/completions/responses/models/images/generations/images/editsclaude-{{docs.closeSentence}}{{docs.16090be1a2}}{{docs.3bd8cf1c63}}{{docs.55442fea7e}}<{{docs.358b5f6606}}>/v1/messageshttps://api.edgeweigh.comx-goog-api-key: <YOUR_API_KEY>/v1beta/models/{model}:generateContenthttps://api.edgeweigh.com/v1Authorization: Bearer <YOUR_API_KEY>/contents/generations/tasks/contents/generations/tasks/{id}{{docs.connectionSDKs}}
{{docs.w408StepCreateKeyBody}} {{docs.w408StepCreateKeyLink}}
{{docs.keyModelsStepLead}}
{{docs.w408ExportApiKey}}
curl https://api.edgeweigh.com/console/key/models \
-H "Authorization: Bearer $API_KEY"{{docs.w666FirstLead}}
curl -sS https://api.edgeweigh.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-5.4", "messages": [{"role": "user", "content": "Hello"}]}'
{"choices": [{"message": {"role": "assistant", "content": "Hello!"}}]}
{{docs.w667FirstOk}}
{{docs.keyModelsCall}}
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
currency | string | {{docs.chrYes}} | {{docs.w408KmFieldCurrency}} |
price_table_id | string | {{docs.chrYes}} | {{docs.w408KmFieldTable}} |
catalog_version | string | {{docs.chrYes}} | {{docs.w408KmFieldVersion}} |
as_of | string | {{docs.chrYes}} | {{docs.w408KmFieldAsOf}} |
models[].model | string | {{docs.chrYes}} | {{docs.w408KmFieldModel}} |
models[].billing | string | {{docs.chrNone}} | {{docs.w408KmFieldBilling}} |
models[].list_price | object | {{docs.chrNone}} | {{docs.w408KmFieldPrice}} |
{
"currency": "USD",
"price_table_id": "example-table",
"catalog_version": "e7a70def23ef26da608501e0bff7f8a76781d64708ca6864adccbe5453b40420",
"as_of": "2026-01-01T00:00:00Z",
"models": [
{"model": "claude-opus-4-6", "billing": "token", "list_price": {"currency": "USD", "input_usd": 1, "output_usd": 2}},
{"model": "gpt-5.4", "billing": "token", "list_price": {"currency": "USD", "input_usd": 1, "output_usd": 2}}
]
}
{{docs.w408KmExampleDisclaimer}}
{{docs.keyModelsFields}}
{{docs.keyModelsCache}}
| {{docs.chrThHttp}} | {{docs.chrThCause}} | {{docs.f47f1edc44}} |
|---|---|---|
200 | {{docs.w408Km200}} | {{docs.w408Km200Action}} |
304 | {{docs.w408Km304}} | {{docs.w408Km304Action}} |
401 | {{docs.w408Km401}} | {{docs.1a81da9aaa}} |
429 | {{docs.w408Km429}} | {{docs.5b0c0cbca3}}Retry-After{{docs.545d5da517}} |
503 | {{docs.w408Km503}} | {{docs.f649282799}} |
| {{docs.w409ThItem}} | {{docs.w408LimitsHeading}} |
|---|---|
| {{docs.w408LimitsTimeout}} | {{docs.w408LimitsTimeoutVal}} |
| {{docs.w408LimitsBody}} | {{docs.w408LimitsBodyVal}} |
| {{docs.w408LimitsImageSize}} | {{docs.w408LimitsImageSizeVal}} |
| {{docs.w408LimitsRetry}} | {{docs.w408LimitsRetryVal}} |
| {{docs.chrThHttp}} | {{docs.chrThCause}} | {{docs.f47f1edc44}} | {{docs.w660ThRetry}} |
|---|---|---|---|
429 | {{docs.w408Err429RateCause}} | {{docs.5b0c0cbca3}}Retry-After{{docs.545d5da517}}x-ratelimit-*{{docs.e3ee915a8e}}anthropic-ratelimit-*{{docs.5884836e1c}} | {{docs.w660Retry429}} |
429 | {{docs.w408Err429QuotaCause}} | {{docs.cf70e96e5a}} | {{docs.w660RetryQuota}} |
401 | {{docs.w408Err401Cause}} | {{docs.1a81da9aaa}} | {{docs.w660RetryFix}} |
403 | {{docs.w408Err403Cause}} | {{docs.599f92a628}} | {{docs.w660RetryFix}} |
404 | {{docs.w408Err404Cause}} | {{docs.8871434fe7}} | {{docs.w660RetryFix}} |
400 | {{docs.w408Err400Cause}} | {{docs.http400}} | {{docs.w660RetryFix}} |
5xx | {{docs.w408Err5xxCause}} | {{docs.f649282799}} | {{docs.w660Retry5xx}} |
x-request-id{{docs.71393f04cd}}high{{docs.w408ImgQualitySuffix}}{{docs.textBilling}}
{{docs.imageBilling}}
{{docs.noImageCharge}}
{{docs.seedanceBilling}}
{{docs.seedanceTokens}}
{{docs.text}}
{{docs.claudeLead}}
{{docs.exampleModel}}
{{docs.modelIdsPrices}}
{{docs.f48aafb884}}{{docs.a33af39752}}<{{docs.358b5f6606}}>| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /v1/chat/completions | {{docs.w408ClaudeEpPurpose}} |
{{docs.w408ExportApiKey}}curl -sS https://api.edgeweigh.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "claude-opus-4-6", "messages": [{"role": "user", "content": "Hello"}]}'{"choices": [{"message": {"role": "assistant", "content": "Hello!"}}]}from openai import OpenAI
client = OpenAI(base_url="https://api.edgeweigh.com/v1", api_key="<YOUR_API_KEY>")
r = client.chat.completions.create(
model="claude-opus-4-6",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.edgeweigh.com/v1",
apiKey: "<YOUR_API_KEY>",
});
const r = await client.chat.completions.create({
model: "claude-opus-4-6",
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);curl https://api.edgeweigh.com/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-6",
"messages": [{"role": "user", "content": "Hello"}]
}'{{docs.16090be1a2}}{{docs.55442fea7e}}<{{docs.358b5f6606}}>| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /v1/messages | {{docs.w408ClaudeEpPurpose}} |
{{docs.w408ExportApiKey}}curl -sS https://api.edgeweigh.com/v1/messages \
-H "x-api-key: $API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{"model": "claude-opus-4-6", "max_tokens": 1024, "messages": [{"role": "user", "content": "Hello"}]}'{"content": [{"type": "text", "text": "Hello!"}]}from anthropic import Anthropic
client = Anthropic(base_url="https://api.edgeweigh.com", api_key="<YOUR_API_KEY>")
r = client.messages.create(
model="claude-opus-4-6",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello"}],
)
print(next(b.text for b in r.content if b.type == "text"))import Anthropic from "@anthropic-ai/sdk";
const client = new Anthropic({
baseURL: "https://api.edgeweigh.com",
apiKey: "<YOUR_API_KEY>",
});
const r = await client.messages.create({
model: "claude-opus-4-6",
max_tokens: 1024,
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.content.find((b) => b.type === "text")?.text);curl https://api.edgeweigh.com/v1/messages \
-H "x-api-key: <YOUR_API_KEY>" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-6",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Hello"}]
}'{{docs.shapeModelNote}}
| {{docs.shape}} | {{docs.790d883ad1}} | {{docs.3d0b6b862c}} |
|---|---|---|
| {{docs.choose}} | {{docs.openaiChoose}} | {{docs.anthropicChoose}} |
| {{docs.fce7fec2a5}} | /v1/chat/completions | /v1/messages |
| {{docs.66880d2d82}} | Authorization: Bearer | x-api-key |
| {{docs.fields}} | model, messages | model, messages, max_tokens |
| {{docs.delivery}} | choices[0].message.content | content[] |
{{docs.w666OpenaiParams}}
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
messages | array | {{docs.chrYes}} | {{docs.w660ClaudeMessages}} |
max_tokens | number | {{docs.chrNone}} | {{docs.w660ClaudeMax}} |
stream | boolean | {{docs.chrNone}} | {{docs.w660ClaudeStreamField}} |
stop | string or array | {{docs.chrNone}} | {{docs.w660ClaudeStop}} |
temperature | number | {{docs.chrNone}} | {{docs.w660ClaudeTemp}} |
tools, tool_choice | array, string or object | {{docs.chrNone}} | {{docs.w660ClaudeTools}} |
{{docs.w666OpenaiImage}}
{
"model": "claude-sonnet-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<BASE64>"}},
{"type": "text", "text": "Describe this image."}
]
}
]
}{{docs.w666OpenaiStream}}
{
"model": "claude-sonnet-5",
"max_tokens": 256,
"stream": true,
"stream_options": {"include_usage": true},
"messages": [{"role": "user", "content": "Hello"}]
}{{docs.w666OpenaiUsage}}
{{docs.claudeParams}}
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
messages | array | {{docs.chrYes}} | {{docs.w660ClaudeMessages}} |
max_tokens | number | {{docs.chrYes}} | {{docs.w660ClaudeMax}} |
system | string | {{docs.chrNone}} | {{docs.w660ClaudeSystem}} |
stream | boolean | {{docs.chrNone}} | {{docs.w660ClaudeStreamField}} |
stop_sequences | array | {{docs.chrNone}} | {{docs.w660ClaudeStop}} |
temperature | number | {{docs.chrNone}} | {{docs.w660ClaudeTemp}} |
tools, tool_choice | array, object | {{docs.chrNone}} | {{docs.w660ClaudeTools}} |
thinking | object | {{docs.chrNone}} | {{docs.w660ClaudeThinking}} |
output_config | object | {{docs.chrNone}} | {{docs.w660ClaudeOutput}} |
{{docs.sonnetThinking}}
{{docs.w660ClaudeImage}}
{
"model": "claude-sonnet-5",
"max_tokens": 256,
"messages": [
{
"role": "user",
"content": [
{"type": "image", "source": {"type": "base64", "media_type": "image/png", "data": "<BASE64>"}},
{"type": "text", "text": "Describe this image."}
]
}
]
}{{docs.w660ClaudeStreamLead}}
{
"model": "claude-sonnet-5",
"max_tokens": 256,
"stream": true,
"messages": [{"role": "user", "content": "Hello"}]
}{{docs.w660ClaudeUsage}}
{{docs.openaiOutput}}
{{docs.anthropicOutput}}
| {{docs.9061383b8e}} | {{docs.f47f1edc44}} |
|---|---|
| {{docs.w408ClaudeLimitCache}} | {{docs.w408ClaudeLimitCacheFix}} |
{{docs.3f3c421836}}cache_control{{docs.0ffb9dfbdb}}/v1/messages{{docs.c8fbe900f4}}/v1/chat/completions, cache_control{{docs.48a9dd0346}}
{{docs.text}}
{{docs.gptLead}}
{{docs.exampleModel}}
{{docs.modelIdsPrices}}
{{docs.f48aafb884}}{{docs.a33af39752}}<{{docs.358b5f6606}}>| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /v1/chat/completions | {{docs.w408GptEpPurpose}} |
POST /v1/responses | {{docs.w666ResponsesPurpose}} |
{{docs.w408ExportApiKey}}curl -sS https://api.edgeweigh.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-5.4", "messages": [{"role": "user", "content": "Hello"}]}'{"choices": [{"message": {"role": "assistant", "content": "Hello!"}}]}from openai import OpenAI
client = OpenAI(base_url="https://api.edgeweigh.com/v1", api_key="<YOUR_API_KEY>")
r = client.chat.completions.create(
model="gpt-5.4",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.edgeweigh.com/v1",
apiKey: "<YOUR_API_KEY>",
});
const r = await client.chat.completions.create({
model: "gpt-5.4",
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);curl https://api.edgeweigh.com/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"messages": [{"role": "user", "content": "Hello"}]
}'{{docs.gptParams}}
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
messages | array | {{docs.chrYes}} | {{docs.w408FieldMessages}} |
max_completion_tokens | number | {{docs.chrNone}} | {{docs.w660GptMax}} |
temperature | number | {{docs.chrNone}} | {{docs.w660GptTemp}} |
stream | boolean | {{docs.chrNone}} | {{docs.w660ClaudeStreamField}} |
tools, tool_choice | array, string or object | {{docs.chrNone}} | {{docs.w660GptTools}} |
response_format | object | {{docs.chrNone}} | {{docs.w660GptFormat}} |
reasoning_effort | string | {{docs.chrNone}} | {{docs.w660GptEffort}} |
verbosity | string | {{docs.chrNone}} | {{docs.w660GptVerbosity}} |
{{docs.w660GptImage}}
{
"model": "gpt-5.4",
"messages": [
{
"role": "user",
"content": [
{"type": "text", "text": "What is in this image?"},
{"type": "image_url", "image_url": {"url": "https://example.com/photo.png", "detail": "high"}}
]
}
]
}{{docs.w408LimitsTimeoutVal}} {{docs.w660GptStreamLead}}
{
"model": "gpt-5.4",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true,
"stream_options": {"include_usage": true}
}{{docs.w666RespA}}input{{docs.w666RespB}}input{{docs.w666RespC}}previous_response_id{{docs.w666RespD}}conversation{{docs.w666RespE}}{{docs.671fae9ed6}}{{docs.w666RespF}}
curl -sS https://api.edgeweigh.com/v1/responses \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "gpt-5.4", "input": "Hello"}'{"output": [{"type": "message", "content": [{"type": "output_text", "text": "Hello!"}]}]}{{docs.w666RespOut}}
from openai import OpenAI client = OpenAI(base_url="https://api.edgeweigh.com/v1", api_key="<YOUR_API_KEY>") r = client.responses.create(model="gpt-5.4", input="Hello") print(r.output_text)
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.edgeweigh.com/v1",
apiKey: "<YOUR_API_KEY>",
});
const r = await client.responses.create({
model: "gpt-5.4",
input: "Hello",
});
console.log(r.output_text);curl https://api.edgeweigh.com/v1/responses \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.4",
"input": "Hello"
}'{{docs.openaiOutput}}
{{docs.5f232ef573}}
/v1/chat/completions| {{docs.62845f31a2}} | {{docs.a5dc35f1ff}} |
|---|---|
stop{{docs.39c3c6d9e6}} | Unsupported parameter: 'stop' is not supported with this model. |
{{docs.bb33dbdb2f}}max_completion_tokens{{docs.99a3d05bfc}}max_tokens. | Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead. |
{{docs.95589b5c4c}}max_completion_tokens{{docs.fea94b0f93}} | max_tokens is too large: N. This model supports at most 128000 completion tokens, whereas you provided N. |
{{docs.dee4b7db2b}}service_tier{{docs.fae0b8449e}}default{{docs.e1a3e78cb5}}auto{{docs.ddf285ad2d}} | Only service_tier 'default' is supported. |
/v1/responses| {{docs.62845f31a2}} | {{docs.a5dc35f1ff}} |
|---|---|
stop{{docs.7dadd2a187}} | Unknown parameter: 'stop'. Did you mean 'store'? |
{{docs.beeb1b571f}}previous_response_id{{docs.e3ee915a8e}}conversation{{docs.37cbbd86bc}}input{{docs.6a0a2ac805}}id{{docs.bae7862a78}}previous_response_id). | Stateful responses are not supported on this platform: omit 'previous_response_id' and send the full conversation in 'input'. |
{{docs.dee4b7db2b}}service_tier{{docs.fae0b8449e}}default{{docs.e1a3e78cb5}}auto{{docs.ddf285ad2d}} | Only service_tier 'default' is supported. |
/v1/messages{{docs.3c7f5957d4}}Model '<id>' is not available on the Messages API. Use /v1/chat/completions or /v1/responses.{{docs.23da30775f}}/v1/chat/completions{{docs.e1a3e78cb5}}/v1/responses{{docs.98876abd11}}
{{docs.text}}
{{docs.w666OtherLead}}
{{docs.exampleModel}}
{{docs.f48aafb884}}{{docs.a33af39752}}<{{docs.358b5f6606}}>| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /v1/chat/completions | {{docs.w408GptEpPurpose}} |
{{docs.w408ExportApiKey}}curl -sS https://api.edgeweigh.com/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-v4-pro-0813", "messages": [{"role": "user", "content": "Hello"}]}'{"choices": [{"message": {"role": "assistant", "content": "Hello!"}}]}from openai import OpenAI
client = OpenAI(base_url="https://api.edgeweigh.com/v1", api_key="<YOUR_API_KEY>")
r = client.chat.completions.create(
model="deepseek-v4-pro-0813",
messages=[{"role": "user", "content": "Hello"}],
)
print(r.choices[0].message.content)import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.edgeweigh.com/v1",
apiKey: "<YOUR_API_KEY>",
});
const r = await client.chat.completions.create({
model: "deepseek-v4-pro-0813",
messages: [{ role: "user", content: "Hello" }],
});
console.log(r.choices[0].message.content);curl https://api.edgeweigh.com/v1/chat/completions \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "deepseek-v4-pro-0813",
"messages": [{"role": "user", "content": "Hello"}]
}'{{docs.w666OtherParams}}
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
messages | array | {{docs.chrYes}} | {{docs.w660ClaudeMessages}} |
max_tokens | number | {{docs.chrNone}} | {{docs.w660ClaudeMax}} |
stream | boolean | {{docs.chrNone}} | {{docs.w660ClaudeStreamField}} |
temperature | number | {{docs.chrNone}} | {{docs.w666OtherTemp}} |
tools | array | {{docs.chrNone}} | {{docs.w666OtherTools}} |
tool_choice | string or object | {{docs.chrNone}} | {{docs.w666OtherToolChoice}} |
{{docs.w666OtherImage}}
{
"model": "deepseek-v4-pro-0813",
"messages": [
{
"role": "user",
"content": [
{"type": "image_url", "image_url": {"url": "data:image/png;base64,<BASE64>"}},
{"type": "text", "text": "Describe this image."}
]
}
]
}{{docs.w666OpenaiStream}}
{
"model": "deepseek-v4-pro-0813",
"max_tokens": 256,
"stream": true,
"stream_options": {"include_usage": true},
"messages": [{"role": "user", "content": "Hello"}]
}{{docs.openaiOutput}}
{{docs.image}}
{{docs.openaiImageLead}}
{{docs.exampleModel}}
{{docs.modelIdsPrices}}
{{docs.f48aafb884}}{{docs.a33af39752}}<{{docs.358b5f6606}}>| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /v1/images/generations | {{docs.w409OaiEpGen}} |
POST /v1/images/edits | {{docs.w409OaiEpEdit}} |
{{docs.w408ExportApiKey}}
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
prompt | string | {{docs.chrYes}} | {{docs.w409FieldPrompt}} |
size | string | {{docs.chrNone}} | {{docs.w409FieldSizeRef}} |
quality | string | {{docs.chrNone}} | {{docs.w409FieldQuality}} |
n | number | {{docs.chrNone}} | {{docs.w660OaiN}} |
curl -sS https://api.edgeweigh.com/v1/images/generations \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A small ceramic teapot on a wooden table by a window",
"size": "1536x1024",
"quality": "medium"
}'# gpt-image-2
{
"data": [{"b64_json": "..."}]
}import base64
from openai import OpenAI
client = OpenAI(base_url="https://api.edgeweigh.com/v1", api_key="<YOUR_API_KEY>")
r = client.images.generate(
model="gpt-image-2",
prompt="A small ceramic teapot on a wooden table by a window",
size="1536x1024",
quality="medium",
)
open("out.png", "wb").write(base64.b64decode(r.data[0].b64_json))
print(r.usage.output_tokens) # image tokens billed for this pictureimport fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.edgeweigh.com/v1",
apiKey: "<YOUR_API_KEY>",
});
const r = await client.images.generate({
model: "gpt-image-2",
prompt: "A small ceramic teapot on a wooden table by a window",
size: "1536x1024",
quality: "medium",
});
fs.writeFileSync("out.png", Buffer.from(r.data[0].b64_json, "base64"));
console.log(r.usage.output_tokens); // image tokens billed for this picturecurl https://api.edgeweigh.com/v1/images/generations \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-image-2",
"prompt": "A small ceramic teapot on a wooden table by a window",
"size": "1536x1024",
"quality": "medium"
}'
# response: {"data":[{"b64_json":"..."}],"usage":{"input_tokens":…,"output_tokens":…}}| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
prompt | string | {{docs.chrYes}} | {{docs.w409FieldPrompt}} |
image[] | file | {{docs.chrYes}} | {{docs.w409FieldImageArr}} |
mask | file | {{docs.chrNone}} | {{docs.w409FieldMask}} |
size | string | {{docs.chrNone}} | {{docs.w409FieldSizeRef}} |
quality | string | {{docs.chrNone}} | {{docs.w409FieldQuality}} |
n | number | {{docs.chrNone}} | {{docs.w660OaiN}} |
output_format | string | {{docs.chrNone}} | {{docs.w409FieldOutputFormat}} |
background | string | {{docs.chrNone}} | {{docs.w409FieldBackground}} |
curl -sS https://api.edgeweigh.com/v1/images/edits \ -H "Authorization: Bearer $API_KEY" \ -F model=gpt-image-2 \ -F "image[]=@ref.png" \ -F "prompt=Make it night time; keep the composition identical" \ -F size=1024x1024 \ -F quality=low
# gpt-image-2
{
"data": [{"b64_json": "..."}]
}import base64
from openai import OpenAI
client = OpenAI(base_url="https://api.edgeweigh.com/v1", api_key="<YOUR_API_KEY>")
r = client.images.edit(
model="gpt-image-2",
image=open("ref.png", "rb"),
prompt="Make it night time; keep the composition identical",
size="1024x1024",
quality="low",
)
open("edited.png", "wb").write(base64.b64decode(r.data[0].b64_json))import fs from "node:fs";
import OpenAI from "openai";
const client = new OpenAI({
baseURL: "https://api.edgeweigh.com/v1",
apiKey: "<YOUR_API_KEY>",
});
const r = await client.images.edit({
model: "gpt-image-2",
image: fs.createReadStream("ref.png"),
prompt: "Make it night time; keep the composition identical",
size: "1024x1024",
quality: "low",
});
fs.writeFileSync("edited.png", Buffer.from(r.data[0].b64_json, "base64"));curl https://api.edgeweigh.com/v1/images/edits \ -H "Authorization: Bearer <YOUR_API_KEY>" \ -F model=gpt-image-2 \ -F "image[]=@ref.png" \ -F "prompt=Make it night time; keep the composition identical" \ -F size=1024x1024 \ -F quality=low
{{docs.openaiShared}}
| {{docs.w409ThItem}} | {{docs.w408LimitsHeading}} |
|---|---|
| {{docs.1af8519073}} | {{docs.fd5147041f}}WxH{{docs.d35a071f3e}}auto |
| {{docs.86e63929fe}} | {{docs.94e7f0f5d9}}/edits{{docs.b915b80609.noPrice}}{{docs.w660OaiRefCap}} |
| {{docs.67a926f700}} | stream / partial_images, response_format: url{{docs.fdd6ec6f29}} |
{{docs.w409ErrLead}}
| {{docs.chrThHttp}} | {{docs.chrThCause}} | {{docs.f47f1edc44}} |
|---|---|---|
400 | {{docs.w409ErrSizeCause}} | {{docs.w409OaiErrSizeFix}} |
400 | {{docs.w409ErrQualityCause}} | {{docs.w409ErrQualityFix}} |
200 | {{docs.w409ErrNoImageCause}} | {{docs.w409ErrNoImageFix}} |
401 | {{docs.w408Err401Cause}} | {{docs.1a81da9aaa}} |
429 | {{docs.w408Err429RateCause}} | {{docs.5b0c0cbca3}}Retry-After{{docs.545d5da517}} |
5xx | {{docs.w408Err5xxCause}} | {{docs.f649282799}} |
data[].b64_json{{docs.a0e52d12f2}}output_format{{docs.c0d9ef85dc}}background: transparent{{docs.29d2ed36e7}}{{docs.8b6c31e885}}{{docs.d43d4bceb8}}{{docs.802d2a1e20}}
{{docs.image}}
{{docs.geminiImageLead}}
{{docs.exampleModel}}
{{docs.modelIdsPrices}}
https://api.edgeweigh.comx-goog-api-key: <YOUR_API_KEY>| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /v1beta/models/{model}:generateContent | {{docs.w409GemEpPurpose}} |
{{docs.w408ExportApiKey}}
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
contents | array | {{docs.chrYes}} | {{docs.w409GemFieldContents}} |
generationConfig.responseModalities | array | {{docs.chrYes}} | {{docs.w409GemFieldModalities}} |
generationConfig.imageConfig.imageSize | string | {{docs.chrNone}} | {{docs.w409GemFieldImageSize}} |
generationConfig.imageConfig.aspectRatio | string | {{docs.chrNone}} | {{docs.w409GemFieldAspectRatio}} |
curl -sS https://api.edgeweigh.com/v1beta/models/gemini-3-pro-image:generateContent \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role": "user", "parts": [
{"text": "A small ceramic teapot on a wooden table by a window"}
]}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {"aspectRatio": "16:9", "imageSize": "2K"}
}
}'# gemini-3-pro-image
{
"candidates": [{
"content": {
"parts": [{"inlineData": {"mimeType": "image/png", "data": "..."}}]
}
}]
}from google import genai
from google.genai import types
client = genai.Client(
api_key="<YOUR_API_KEY>",
http_options={"base_url": "https://api.edgeweigh.com"},
)
r = client.models.generate_content(
model="gemini-3-pro-image",
contents="A small ceramic teapot on a wooden table by a window",
config=types.GenerateContentConfig(
response_modalities=["IMAGE"],
image_config=types.ImageConfig(aspect_ratio="16:9", image_size="2K"),
),
)
image = None
for part in r.candidates[0].content.parts:
if not part.thought and part.inline_data and part.inline_data.mime_type.startswith("image/"):
image = part.inline_data.data
if image is None:
raise RuntimeError("No final image returned")
with open("out.png", "wb") as output:
output.write(image)import fs from "node:fs";
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({
apiKey: "<YOUR_API_KEY>",
httpOptions: { baseUrl: "https://api.edgeweigh.com" },
});
const r = await ai.models.generateContent({
model: "gemini-3-pro-image",
contents: "A small ceramic teapot on a wooden table by a window",
config: {
responseModalities: ["IMAGE"],
imageConfig: { aspectRatio: "16:9", imageSize: "2K" },
},
});
let data;
for (const part of r.candidates[0].content.parts) {
if (!part.thought && part.inlineData?.mimeType?.startsWith("image/")) {
data = part.inlineData.data;
}
}
if (!data) throw new Error("No final image returned");
fs.writeFileSync("out.png", Buffer.from(data, "base64"));curl https://api.edgeweigh.com/v1beta/models/gemini-3-pro-image:generateContent \
-H "x-goog-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role": "user", "parts": [
{"text": "A small ceramic teapot on a wooden table by a window"}
]}],
"generationConfig": {
"responseModalities": ["IMAGE"],
"imageConfig": {"aspectRatio": "16:9", "imageSize": "2K"}
}
}'
# Inspect every candidates[0].content.parts entry; skip parts with thought: true.
# Use the last part with image inlineData (mimeType starts with image/).| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
contents | array | {{docs.chrYes}} | {{docs.w409GemFieldContents}} |
contents[].parts[].inlineData | object | {{docs.chrYes}} | {{docs.w409GemFieldInline}} |
generationConfig.responseModalities | array | {{docs.chrYes}} | {{docs.w409GemFieldModalities}} |
REF=$(base64 < ref.png | tr -d '\n')
curl -sS https://api.edgeweigh.com/v1beta/models/gemini-3.1-flash-image:generateContent \
-H "x-goog-api-key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role": "user", "parts": [
{"inlineData": {"mimeType": "image/png", "data": "'"$REF"'"}},
{"text": "Make it night time; keep the composition identical"}
]}],
"generationConfig": {"responseModalities": ["IMAGE"]}
}'# gemini-3.1-flash-image
{
"candidates": [{
"content": {
"parts": [{"inlineData": {"mimeType": "image/png", "data": "..."}}]
}
}]
}from google import genai
from google.genai import types
client = genai.Client(
api_key="<YOUR_API_KEY>",
http_options={"base_url": "https://api.edgeweigh.com"},
)
r = client.models.generate_content(
model="gemini-3.1-flash-image",
contents=[
types.Part.from_bytes(data=open("ref.png", "rb").read(), mime_type="image/png"),
"Make it night time; keep the composition identical",
],
config=types.GenerateContentConfig(response_modalities=["IMAGE"]),
)
image = None
for part in r.candidates[0].content.parts:
if not part.thought and part.inline_data and part.inline_data.mime_type.startswith("image/"):
image = part.inline_data.data
if image is None:
raise RuntimeError("No final image returned")
with open("edited.png", "wb") as output:
output.write(image)import fs from "node:fs";
import { GoogleGenAI } from "@google/genai";
const ai = new GoogleGenAI({
apiKey: "<YOUR_API_KEY>",
httpOptions: { baseUrl: "https://api.edgeweigh.com" },
});
const ref = fs.readFileSync("ref.png").toString("base64");
const r = await ai.models.generateContent({
model: "gemini-3.1-flash-image",
contents: [
{ inlineData: { mimeType: "image/png", data: ref } },
{ text: "Make it night time; keep the composition identical" },
],
config: { responseModalities: ["IMAGE"] },
});
let data;
for (const part of r.candidates[0].content.parts) {
if (!part.thought && part.inlineData?.mimeType?.startsWith("image/")) {
data = part.inlineData.data;
}
}
if (!data) throw new Error("No final image returned");
fs.writeFileSync("edited.png", Buffer.from(data, "base64"));# base64-encode the reference first: REF=$(base64 -w0 ref.png)
curl https://api.edgeweigh.com/v1beta/models/gemini-3.1-flash-image:generateContent \
-H "x-goog-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"contents": [{"role": "user", "parts": [
{"inlineData": {"mimeType": "image/png", "data": "'"$REF"'"}},
{"text": "Make it night time; keep the composition identical"}
]}],
"generationConfig": {"responseModalities": ["IMAGE"]}
}'
# Inspect every candidates[0].content.parts entry; skip parts with thought: true.
# Use the last part with image inlineData (mimeType starts with image/).{{docs.4785544f1b}}parts{{docs.374d9fbf0b}}generateContent{{docs.8a939d7ee7}}imageSize{{docs.2036479b8b}}
| {{docs.w409ThItem}} | {{docs.w408LimitsHeading}} |
|---|---|
| {{docs.3505c24b71}} | generationConfig.imageConfig.imageSize{{docs.7624012666}}aspectRatio 1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9 |
| {{docs.86e63929fe}} | inlineData{{docs.f9b47a4715}}contents[].parts[]{{docs.geminiRefLimit}} |
{{docs.w660GemSize}}{{docs.w660GemAspect}}
{{docs.w660GemStream}}
{{docs.w409ErrLead}}
| {{docs.chrThHttp}} | {{docs.chrThCause}} | {{docs.f47f1edc44}} |
|---|---|---|
400 | {{docs.w409ErrSizeCause}} | {{docs.w409GemErrSizeFix}} |
200 | {{docs.w409ErrNoImageCause}} | {{docs.w409ErrNoImageFix}} |
401 | {{docs.w408Err401Cause}} | {{docs.1a81da9aaa}} |
429 | {{docs.w408Err429RateCause}} | {{docs.5b0c0cbca3}}Retry-After{{docs.545d5da517}} |
5xx | {{docs.w408Err5xxCause}} | {{docs.f649282799}} |
candidates[0].content.parts[].inlineData{{docs.geminiOutput}}"thought": true{{docs.geminiDraftTail}}{{docs.8b6c31e885}}{{docs.d43d4bceb8}}{{docs.802d2a1e20}}
{{docs.video}}
{{docs.seedanceLead}}
{{docs.exampleModel}}
{{docs.modelIdsPrices}}
{{docs.f48aafb884}}{{docs.a33af39752}}<{{docs.358b5f6606}}>| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /contents/generations/tasks | {{docs.w410EpArkCreate}} |
GET /contents/generations/tasks/{id} | {{docs.w410EpArkRetrieve}} |
GET /contents/generations/tasks | {{docs.w410EpArkList}} |
{{docs.w408ExportApiKey}}
POST /v1/contents/generations/tasks
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
content | array | {{docs.chrYes}} | {{docs.seedanceArkFields}} |
resolution | string | {{docs.chrNone}} | {{docs.seedanceResolution}} |
duration | number | {{docs.chrNone}} | {{docs.seedanceDuration}} |
curl -sS https://api.edgeweigh.com/v1/contents/generations/tasks \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "dreamina-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "A red kite over the sea"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/kite.png"
},
"role": "first_frame"
}
],
"resolution": "720p",
"duration": 5
}'{
"id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh"
}{{docs.w410TaskIdNote}}
GET /v1/contents/generations/tasks/$TASK_ID
{{docs.seedancePoll}}
{{docs.w588PollNote}}
curl -sS "https://api.edgeweigh.com/v1/contents/generations/tasks/$TASK_ID" \ -H "Authorization: Bearer $API_KEY"
{
"content": {
"video_url": "https://example.com/video.mp4"
},
"created_at": 1793610000,
"duration": 5,
"framespersecond": 24,
"generate_audio": false,
"id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh",
"model": "dreamina-seedance-2-0-260128",
"ratio": "16:9",
"resolution": "720p",
"status": "succeeded",
"updated_at": 1793610030,
"usage": {
"completion_tokens": 108900,
"total_tokens": 108900
}
}{{docs.w410ArkVideoLead}}
# pip install requests
import os
import time
import requests
base = "https://api.edgeweigh.com/v1"
headers = {"Authorization": "Bearer " + os.environ["API_KEY"]}
body = {
"model": "dreamina-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "a red kite over the sea"
}
],
"resolution": "720p",
"duration": 5
}
created = requests.post(base + "/contents/generations/tasks", headers=headers,
json=body, timeout=60)
created.raise_for_status()
task_id = created.json()["id"]
while True:
result = requests.get(base + "/contents/generations/tasks/" + task_id,
headers=headers, timeout=60)
result.raise_for_status()
video = result.json()
if video["status"] in ("queued", "running"):
time.sleep(5)
continue
if video["status"] == "succeeded":
url = video["content"]["video_url"]
download = requests.get(url, timeout=60)
download.raise_for_status()
with open("video.mp4", "wb") as output:
output.write(download.content)
elif video["status"] == "failed":
print(video["error"]["code"], video["error"]["message"])
else:
raise RuntimeError("Unexpected task status: " + video["status"])
breakconst base = "https://api.edgeweigh.com/v1";
const headers = { Authorization: `Bearer ${process.env.API_KEY}` };
const body = {
"model": "dreamina-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "a red kite over the sea"
}
],
"resolution": "720p",
"duration": 5
};
const created = await fetch(base + "/contents/generations/tasks", {
method: "POST", headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify(body),
});
if (!created.ok) throw new Error(await created.text());
const { id } = await created.json();
while (true) {
const result = await fetch(base + "/contents/generations/tasks/" + id, { headers });
if (!result.ok) throw new Error(await result.text());
const video = await result.json();
if (["queued", "running"].includes(video.status)) {
await new Promise(resolve => setTimeout(resolve, 5000));
continue;
}
if (video.status === "succeeded") {
const url = video.content.video_url;
const download = await fetch(url);
if (!download.ok) throw new Error(await download.text());
const { writeFile } = await import("node:fs/promises");
await writeFile("video.mp4", Buffer.from(await download.arrayBuffer()));
} else if (video.status === "failed") {
console.log(video.error.code, video.error.message);
} else {
throw new Error("Unexpected task status: " + video.status);
}
break;
}curl -sS --fail-with-body https://api.edgeweigh.com/v1/contents/generations/tasks \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"model": "dreamina-seedance-2-0-260128",
"content": [
{
"type": "text",
"text": "a red kite over the sea"
}
],
"resolution": "720p",
"duration": 5
}
'
# Set TASK_ID to the id returned above.
TASK_ID="task_REPLACE_ME"
sleep 10
curl -sS --fail-with-body \
"https://api.edgeweigh.com/v1/contents/generations/tasks/$TASK_ID" \
-H "Authorization: Bearer $API_KEY"
curl -sS --fail-with-body \
"https://api.edgeweigh.com/v1/contents/generations/tasks?page_num=1&page_size=10" \
-H "Authorization: Bearer $API_KEY"{{docs.seedanceArkFields}}
| {{docs.w660Scen}} | {{docs.w660ScenHow}} | {{docs.w660ScenCount}} | {{docs.w660ScenMutex}} |
|---|---|---|---|
| {{docs.w660ScText}} | {{docs.w660ScTextHow}} | {{docs.chrNone}} | {{docs.chrNone}} |
| {{docs.w660ScFirst}} | {{docs.w660ScFirstHow}} | {{docs.w660ScOne}} | {{docs.w660ScRef}} |
| {{docs.w660ScEnds}} | {{docs.w660ScEndsHow}} | {{docs.w660ScTwo}} | {{docs.w660ScRef}} |
| {{docs.w660ScRef}} | {{docs.w660ScRefHow}} | {{docs.w660ScRefCount}} | {{docs.w660ScEnds}} |
| {{docs.w660ScAudio}} | {{docs.w660ScAudioHow}} | {{docs.w660Sc25}} | {{docs.chrNone}} |
| {{docs.w660ScEdit}} | {{docs.w660ScEditHow}} | {{docs.w660Sc25}} | {{docs.chrNone}} |
| {{docs.w660ScFace}} | {{docs.w660ScFaceHow}} {{docs.charactersTitle}} | {{docs.chrNone}} | {{docs.w660ScFaceNo}} |
{
"model": "dreamina-seedance-2-0-260128",
"content": [{"type": "text", "text": "a red kite over the sea"}],
"ratio": "16:9",
"duration": 5
}{
"model": "dreamina-seedance-2-0-260128",
"content": [
{"type": "text", "text": "the kite lifts off"},
{"type": "image_url", "image_url": {"url": "https://example.com/first.png"}, "role": "first_frame"}
],
"ratio": "16:9",
"duration": 5
}{
"model": "dreamina-seedance-2-0-260128",
"content": [
{"type": "text", "text": "the kite crosses the bay"},
{"type": "image_url", "image_url": {"url": "https://example.com/first.png"}, "role": "first_frame"},
{"type": "image_url", "image_url": {"url": "https://example.com/last.png"}, "role": "last_frame"}
],
"ratio": "adaptive",
"duration": 5
}{
"model": "dreamina-seedance-2-5-260628",
"content": [
{"type": "text", "text": "match the reference"},
{"type": "image_url", "image_url": {"url": "https://example.com/ref.png"}, "role": "reference_image"}
],
"ratio": "adaptive",
"duration": 5
}{
"model": "dreamina-seedance-2-5-260628",
"content": [
{"type": "text", "text": "a quiet street at night"},
{"type": "audio_url", "audio_url": {"url": "https://example.com/rain.mp3"}, "role": "reference_audio"}
],
"duration": 5
}{
"model": "dreamina-seedance-2-5-260628",
"content": [
{"type": "text", "text": "extend the shot"},
{"type": "video_url", "video_url": {"url": "https://example.com/clip.mp4"}, "role": "reference_video"}
],
"omni_reference_task_type": "extend",
"ratio": "adaptive",
"duration": -1
}{
"model": "dreamina-seedance-2-5-260628",
"content": [
{"type": "text", "text": "the character waves"},
{"type": "image_url", "image_url": {"url": "character://char_0123456789abcdef0123456789abcdef/media_0123456789abcdef0123456789abcdef"}, "role": "reference_image"}
],
"resolution": "720p",
"duration": 5
}{{docs.f48aafb884}}{{docs.a33af39752}}<{{docs.358b5f6606}}>| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /videos | {{docs.w410EpOaiCreate}} |
GET /videos/{id} | {{docs.w410EpOaiRetrieve}} |
GET /videos | {{docs.w410EpOaiList}} |
GET /videos/{id}/content | {{docs.w410EpOaiDownload}} |
{{docs.w408ExportApiKey}}
POST /v1/videos
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
prompt | string | {{docs.chrYes}} | {{docs.w410FieldPrompt}} |
seconds | string | {{docs.chrNone}} | {{docs.seedanceDuration}} |
size | string | {{docs.chrNone}} | {{docs.w410FieldSize}} |
curl -sS https://api.edgeweigh.com/v1/videos \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "dreamina-seedance-2-0-260128", "prompt": "a red kite over the sea", "seconds": "5", "size": "1280x720"}'{"id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh", "status": "queued"}{{docs.w410TaskIdNote}}
GET /v1/videos/$TASK_ID
{{docs.seedancePoll}}
curl -sS "https://api.edgeweigh.com/v1/videos/$TASK_ID" \ -H "Authorization: Bearer $API_KEY"
{
"id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh",
"object": "video",
"status": "completed",
"metadata": {"url": "https://example.com/video.mp4"}
}GET /v1/videos/$TASK_ID/content
{{docs.w410OpenaiDownloadLead}}
curl -sS -L "https://api.edgeweigh.com/v1/videos/$TASK_ID/content" \ -H "Authorization: Bearer $API_KEY" -o video.mp4
HTTP 302 with Location header (download without API key)
# pip install requests
import os
import time
import requests
base = "https://api.edgeweigh.com/v1"
headers = {"Authorization": "Bearer " + os.environ["API_KEY"]}
body = {
"model": "dreamina-seedance-2-0-260128",
"prompt": "a red kite over the sea",
"seconds": "5",
"size": "1280x720"
}
created = requests.post(base + "/videos", headers=headers,
json=body, timeout=60)
created.raise_for_status()
task_id = created.json()["id"]
while True:
result = requests.get(base + "/videos/" + task_id,
headers=headers, timeout=60)
result.raise_for_status()
video = result.json()
if video["status"] in ("queued", "running", "in_progress"):
time.sleep(5)
continue
if video["status"] == "completed":
redirect = requests.get(base + "/videos/" + task_id + "/content",
headers=headers, allow_redirects=False, timeout=60)
if redirect.status_code != 302:
raise RuntimeError(redirect.text)
url = redirect.headers["Location"]
download = requests.get(url, timeout=60)
download.raise_for_status()
with open("video.mp4", "wb") as output:
output.write(download.content)
elif video["status"] == "failed":
print(video["error"]["code"], video["error"]["message"])
else:
raise RuntimeError("Unexpected task status: " + video["status"])
breakconst base = "https://api.edgeweigh.com/v1";
const headers = { Authorization: `Bearer ${process.env.API_KEY}` };
const body = {
"model": "dreamina-seedance-2-0-260128",
"prompt": "a red kite over the sea",
"seconds": "5",
"size": "1280x720"
};
const created = await fetch(base + "/videos", {
method: "POST", headers: { ...headers, "Content-Type": "application/json" },
body: JSON.stringify(body),
});
if (!created.ok) throw new Error(await created.text());
const { id } = await created.json();
while (true) {
const result = await fetch(base + "/videos/" + id, { headers });
if (!result.ok) throw new Error(await result.text());
const video = await result.json();
if (["queued", "running", "in_progress"].includes(video.status)) {
await new Promise(resolve => setTimeout(resolve, 5000));
continue;
}
if (video.status === "completed") {
const redirect = await fetch(base + "/videos/" + id + "/content", {
headers, redirect: "manual",
});
if (redirect.status !== 302) throw new Error(await redirect.text());
const url = redirect.headers.get("location");
const download = await fetch(url);
if (!download.ok) throw new Error(await download.text());
const { writeFile } = await import("node:fs/promises");
await writeFile("video.mp4", Buffer.from(await download.arrayBuffer()));
} else if (video.status === "failed") {
console.log(video.error.code, video.error.message);
} else {
throw new Error("Unexpected task status: " + video.status);
}
break;
}curl -sS --fail-with-body https://api.edgeweigh.com/v1/videos \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '
{
"model": "dreamina-seedance-2-0-260128",
"prompt": "a red kite over the sea",
"seconds": "5",
"size": "1280x720"
}
'
# Set TASK_ID to the id returned above.
TASK_ID="task_REPLACE_ME"
sleep 10
curl -sS --fail-with-body \
"https://api.edgeweigh.com/v1/videos/$TASK_ID" \
-H "Authorization: Bearer $API_KEY"
curl -sS --fail-with-body \
"https://api.edgeweigh.com/v1/videos?limit=20&order=desc" \
-H "Authorization: Bearer $API_KEY"
# Only after status is completed. Do not use --location-trusted.
curl -sS --fail-with-body -L \
"https://api.edgeweigh.com/v1/videos/$TASK_ID/content" \
-H "Authorization: Bearer $API_KEY" -o video.mp4{{docs.seedanceFormats}}
{{docs.seedanceArkList}}
{{docs.seedanceOpenaiList}}
{{docs.seedancePending}}
{{docs.w667ExampleRoutes}}
{{docs.w660SdModelLead}}
{{docs.w660SdLimits}}
{{docs.seedanceRules}} {{docs.charactersTitle}}
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
content | array | {{docs.chrYes}} | {{docs.seedanceMedia}} |
content[].type | string | {{docs.chrYes}} | text, image_url, video_url, audio_url |
content[].role | string | {{docs.chrNone}} | {{docs.seedanceRoles}} |
resolution | string | {{docs.chrNone}} | {{docs.seedanceResolution}} |
duration | number | {{docs.chrNone}} | {{docs.seedanceDuration}} {{docs.seedanceDurationAuto}} |
ratio | string | {{docs.chrNone}} | {{docs.w410FieldRatio}} |
output_format | string | {{docs.chrNone}} | {{docs.seedanceOutputFormat}} |
omni_reference_task_type | string | {{docs.chrNone}} | {{docs.seedanceOmniReferenceTaskType}} |
return_last_frame | boolean | {{docs.chrNone}} | {{docs.seedanceReturnLastFrame}} |
generate_audio | boolean | {{docs.chrNone}} | {{docs.w660SdAudio}} |
watermark | boolean | {{docs.chrNone}} | {{docs.w660SdMark}} |
{{docs.w664SdAudioOnly}}
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
model | string | {{docs.chrYes}} | {{docs.w408FieldModel}} |
prompt | string | {{docs.chrYes}} | {{docs.w410FieldPrompt}} |
seconds | string | {{docs.chrNone}} | {{docs.seedanceDuration}} {{docs.seedanceDurationAuto}} |
size | string | {{docs.chrNone}} | {{docs.w410FieldSize}} |
input_reference | string | {{docs.chrNone}} | {{docs.w410FieldInputRef}} |
metadata | object | {{docs.chrNone}} | {{docs.w410FieldMetadata}} |
metadata.generate_audio | boolean | {{docs.chrNone}} | {{docs.w660SdAudio}} {{docs.w660SdOaiMeta}} |
metadata.watermark | boolean | {{docs.chrNone}} | {{docs.w660SdMark}} {{docs.w660SdOaiMeta}} |
{{docs.w660SdOaiMeta}}
{{docs.seedanceArkOutput}}
| {{docs.chrThStatus}} | {{docs.chrThMeaning}} |
|---|---|
queued | {{docs.w410StQueued}} |
running | {{docs.w410StRunning}} |
succeeded | {{docs.w410StSucceeded}} |
failed | {{docs.w410StFailed}} |
{
"id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh",
"status": "succeeded",
"content": {"video_url": "https://example.com/video.mp4", "last_frame_url": "https://example.com/last.jpg"}
}{{docs.seedanceOpenaiOutput}}
| {{docs.chrThStatus}} | {{docs.chrThMeaning}} |
|---|---|
queued | {{docs.w410StQueued}} |
in_progress | {{docs.w410StRunning}} |
completed | {{docs.w410StSucceeded}} |
failed | {{docs.w410StFailed}} |
{
"object": "list",
"data": [{"id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh", "object": "video", "status": "completed"}],
"has_more": false,
"first_id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh",
"last_id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh"
}{{docs.seedanceDelivery}}
{{docs.seedanceBilling}}
{{docs.seedanceTokens}}
{{docs.params}} {{docs.seedanceFailures}}
| {{docs.w408LimitsHeading}} |
|---|
| {{docs.seedanceUnsupported}} |
| {{docs.seedancePending}} |
| {{docs.chrThHttp}} | {{docs.chrThCause}} | {{docs.f47f1edc44}} |
|---|---|---|
409 | {{docs.seedance409Cause}} | {{docs.seedance409Fix}} |
410 | {{docs.seedance410Cause}} | {{docs.seedance410Fix}} |
| {{docs.w410ErrNonHttp}} | {{docs.seedanceStorageCause}} | {{docs.seedanceStorageFix}} |
401 | {{docs.w408Err401Cause}} | {{docs.1a81da9aaa}} |
403 | {{docs.w408Err403Cause}} | {{docs.w410Err403Fix}} |
404 | {{docs.w408Err404Cause}} | {{docs.w410Err404Fix}} |
429 | {{docs.w408Err429RateCause}} | {{docs.5b0c0cbca3}}Retry-After{{docs.545d5da517}} |
503 | {{docs.w408Err5xxCause}} | {{docs.f649282799}} |
{{docs.w660OaiAppLead}}
{
"model": "dreamina-seedance-2-5-260628",
"prompt": "a red kite over the sea",
"seconds": "5",
"size": "1280x720",
"metadata": {"generate_audio": true, "watermark": false}
}{{docs.video}}
{{docs.chrIntro1}}character://{{docs.chrIntro2}}
{{docs.chrAvail1}}kind: aigc{{docs.chrAvail2}}
https://api.edgeweigh.comAuthorization: Bearer <YOUR_API_KEY>| {{docs.chrThEndpoint}} | {{docs.chrThPurpose}} |
|---|---|
POST /v1/characters | {{docs.chrEpCreate}} |
GET /v1/characters | {{docs.chrEpList}} |
GET /v1/characters/{id} | {{docs.chrEpGet}} |
POST /v1/characters/{id}/media | {{docs.chrEpMedia}} |
DELETE /v1/characters/{id} | {{docs.chrEpDelete}} |
POST /v1/characters
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
kind | string | {{docs.chrYes}} | {{docs.chrFKind1}}aigc{{docs.chrFKind2}}real{{docs.chrFKind3}}403{{docs.chrFKind4}} |
name | string | {{docs.chrYes}} | {{docs.chrFName}} |
provenance | object | {{docs.chrYes}} | {{docs.chrFProvenance1}}source{{docs.chrFProvenance2}}task{{docs.chrFProvenance3}}model{{docs.chrFProvenance4}}created_at{{docs.chrFProvenance5}} |
curl -sS https://api.edgeweigh.com/v1/characters \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "aigc",
"name": "Mia",
"provenance": {
"source": "my-app",
"task": "task_last_frame_1234",
"model": "doubao-seedance-2-0-260128",
"created_at": "2026-10-22T14:52:00Z"
}
}'{
"id": "char_f7e7637a66c7319e909c5093c179fc8d",
"name": "Mia",
"kind": "aigc",
"status": "active",
"provenance": {"source": "my-app", "task": "task_last_frame_1234", "model": "doubao-seedance-2-0-260128", "created_at": "2026-10-22T14:52:00Z"},
"consent": {},
"media": []
}{{docs.chrCreateNote1}}id{{docs.chrCreateNote2}}active{{docs.chrCreateNote3}}active{{docs.chrCreateNote4}}
POST /v1/characters/{id}/media
| {{docs.chrThField}} | {{docs.chrThType}} | {{docs.chrThRequired}} | {{docs.chrThDesc}} |
|---|---|---|---|
url | string | {{docs.chrYes}} | {{docs.chrFUrl1}}http{{docs.chrFUrl2}}https{{docs.chrFUrl3}}200{{docs.chrFUrl4}}active{{docs.chrFUrl5}} |
type | string | {{docs.chrYes}} | image{{docs.chrFType1}}video{{docs.chrFType2}}audio{{docs.chrFType3}} |
curl -sS https://api.edgeweigh.com/v1/characters/$CHAR_ID/media \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/mia.jpg", "type": "image"}'{
"media_id": "media_f449d75261b5c7eec86be62bfa7bc14a",
"url": "https://example.com/mia.jpg",
"type": "image",
"sha256": "7e328df46f814e281c8ede0824f6fba15de7cf05e469586cc8fb47d0eb82d5e4",
"size_bytes": 246999,
"width": 720,
"height": 1280,
"duration_s": 0,
"fps": 25,
"format": "jpeg_pipe",
"status": "processing"
}{{docs.chrMediaNote1}}size_bytes{{docs.chrMediaNote2}}width{{docs.chrMediaNote3}}height{{docs.chrMediaNote4}}duration_s{{docs.chrMediaNote5}}fps{{docs.chrMediaNote6}}format{{docs.chrMediaNote7}}sha256{{docs.chrMediaNote8}}status: processing{{docs.chrMediaNote9}}media_id{{docs.chrMediaNote10}}
GET /v1/characters/{id}
{{docs.chrStatusLead1}}status{{docs.chrStatusLead2}}processing{{docs.chrStatusLead3}}active{{docs.chrStatusLead4}}
| {{docs.chrThStatus}} | {{docs.chrThMeaning}} |
|---|---|
processing | {{docs.chrStProcessing}} |
active | {{docs.chrStActive}} |
failed | {{docs.chrStFailed}} |
registering | {{docs.chrStRegistering1}}503{{docs.chrStRegistering2}} |
curl -sS https://api.edgeweigh.com/v1/characters/$CHAR_ID \ -H "Authorization: Bearer $API_KEY"
{
"id": "char_f7e7637a66c7319e909c5093c179fc8d",
"name": "Mia",
"kind": "aigc",
"status": "active",
"provenance": {"source": "my-app", "task": "task_last_frame_1234", "model": "doubao-seedance-2-0-260128", "created_at": "2026-10-22T14:52:00Z"},
"consent": {},
"media": [
{"media_id": "media_f449d75261b5c7eec86be62bfa7bc14a", "type": "image", "width": 720, "height": 1280, "status": "active", "...": "..."}
]
}{{docs.chrUseLead1}}image_url{{docs.chrUseLead2}}video_url{{docs.chrUseLead3}}audio_url{{docs.chrUseLead4}}url{{docs.chrUseLead5}}character://<char_id>/<media_id>{{docs.chrUseLead6}}
POST /v1/contents/generations/tasks
curl -sS https://api.edgeweigh.com/v1/contents/generations/tasks \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "doubao-seedance-2-0-mini-260615",
"content": [
{
"type": "text",
"text": "The woman in the reference image smiles at the camera, soft daylight"
},
{
"type": "image_url",
"image_url": {
"url": "character://char_f7e7637a66c7319e909c5093c179fc8d/media_f449d75261b5c7eec86be62bfa7bc14a"
},
"role": "reference_image"
}
],
"resolution": "480p",
"ratio": "adaptive",
"duration": 4
}'{
"id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh"
}{{docs.chrUseOpenai}}
{{docs.chrUseNote1}}active{{docs.chrUseNote2}}X-Canvas-User{{docs.chrUseNote3}}400{{docs.chrUseNote4}}
DELETE /v1/characters/{id}
{{docs.chrDeleteBody1}}status: deleted{{docs.chrDeleteBody2}}
curl -sS -X DELETE https://api.edgeweigh.com/v1/characters/$CHAR_ID \ -H "Authorization: Bearer $API_KEY"
{"id": "char_f7e7637a66c7319e909c5093c179fc8d", "status": "deleted"}{{docs.chrLegacy1}}asset://…{{docs.chrLegacy2}}
{{docs.chrOwner1}}X-Canvas-User{{docs.chrOwner2}}404{{docs.chrOwner3}}400{{docs.chrOwner4}}
| {{docs.chrThType}} | {{docs.chrThFormat}} | {{docs.chrThSize}} | {{docs.chrThDuration}} | {{docs.chrThOther}} |
|---|---|---|---|---|
image | {{docs.chrImgFmt}} | {{docs.chrImgSize}} | {{docs.chrNone}} | {{docs.chrImgOther}} |
video | {{docs.chrVidFmt}} | {{docs.chrVidSize}} | {{docs.chrSecs}} | {{docs.chrVidOther}} |
audio | {{docs.chrAudFmt}} | {{docs.chrAudSize}} | {{docs.chrSecs}} | {{docs.chrNone}} |
429{{docs.chrLim32}}{{docs.chrErrLead1}}{"error": {"message": "…", "type": "invalid_request_error"}}{{docs.chrErrLead2}}
| {{docs.chrThHttp}} | {{docs.chrThCause}} | {{docs.f47f1edc44}} |
|---|---|---|
400 | {{docs.chrE4001}}kind{{docs.chrE4002}}name{{docs.chrE4003}}provenance{{docs.chrE4004}}active{{docs.chrE4005}} | {{docs.chrF400}} |
403 | {{docs.chrE4031}}kind: real{{docs.chrE4032}} | {{docs.chrF4031}}kind: aigc{{docs.chrF4032}} |
404 | {{docs.chrE4041}}X-Canvas-User{{docs.chrE4042}} | {{docs.chrF4041}}id{{docs.chrF4042}}X-Canvas-User{{docs.chrF4043}} |
405 | {{docs.chrE405}} | {{docs.chrF405}} |
409 | {{docs.chrE409}} | {{docs.chrF4091}}409{{docs.chrF4092}} |
429 | {{docs.chrE429}} | {{docs.chrF429}} |
503 | {{docs.chrE5031}}registering{{docs.chrE5032}} | {{docs.chrF503}} |
{{docs.seedanceUsage}} · {{docs.seedanceFailures}}
{{docs.w588FaceRule}}
{{docs.w588Availability}}
| {{docs.w588Plan}} | {{docs.w588KeyScope}} | {{docs.w588Support}} | {{docs.w588Rule}} |
|---|---|---|---|
| {{models.plan_video}} | {{docs.w588EnabledKeys}} | {{docs.w588Supported}} | {{docs.w588FaceShort}} |
| {{models.plan_video}} | {{docs.w588OtherKeys}} | {{docs.w588Unsupported}} | {{docs.w588Unknown}} |
| {{models.plan_video_byteplus}} | {{docs.w588AllKeys}} | {{docs.w588Supported}} | {{docs.w588FaceShort}} |
{{docs.video}}
{{docs.w588Flow}}
{{docs.w588Routes}}
{{docs.charactersTitle}} · {{docs.seedanceUsage}}
{{docs.w588FailureNote}}
HTTP / status | error.code | error.message | {{docs.w588Action}} |
|---|---|---|---|
400 | InvalidParameter | {{docs.w588ValidationMessage}} | {{docs.w588ValidationMeaning}} {{docs.w588ValidationAction}} |
400 / error; 200 / failed | Input*SensitiveContentDetected. | Realistic faces, including AI-generated faces, cannot be submitted directly. Register the character first and use character://. | {{docs.w588FaceMeaning}} {{docs.w588FaceAction}} |
400 / error; 200 / failed | Input*SensitiveContentDetected | The reference material did not pass the content safety check. Change the reference material and try again. | {{docs.w588InputMeaning}} {{docs.w588InputAction}} |
400 / error; 200 / failed | Output*SensitiveContentDetected | The generated video did not pass the content safety check. Change the prompt or reference material and try again. | {{docs.w588OutputMeaning}} {{docs.w588OutputAction}} |
400 / error; 200 / failed | InvalidParameter | A parameter or reference material is invalid. Check that image and video URLs are publicly downloadable. | {{docs.w588InvalidMeaning}} {{docs.w588InvalidAction}} |
400 / error; 200 / failed | TaskFailed; key_model_not_allowed; RiskControl; ContentPolicyViolation; video_generation_prompt_unsafe; video_generation_output_unsafe | The video generation task failed. | {{docs.w588GenericMeaning}} {{docs.w588GenericAction}} |
200 / failed | TaskFailed | The task timed out. | {{docs.w588TimeoutMeaning}} {{docs.w588TimeoutAction}} |
{
"created_at": 1793610000,
"error": {
"code": "InputImageSensitiveContentDetected.PrivacyInformation",
"message": "Realistic faces, including AI-generated faces, cannot be submitted directly. Register the character first and use character://."
},
"id": "task_LgpeoM7DqZypIanzbPM0RRQJtGuHgzOh",
"model": "dreamina-seedance-2-0-260128",
"status": "failed",
"updated_at": 1793610030
}
{{docs.otherFailureJson}}
{{overview.101d7c2268}}
{{overview.629e263f8c}}
{{overview.debtTopup}}
{{overview.bea80bab3d}}
{{overview.ec8767f0fc}}
{{overview.billingTimezone}}
{{overview.bae7cffe31}}
{{models.dc9b47c81b}}
{{audit.6fbf8aa012}}
list_usd × price_ratio = charged_usd{{audit.d26cdd3d20}}{{audit.5d9b4fe434}}
charged_usd{{audit.3ee15f90ed}}cost_usd{{audit.ee7fa88daa}}price_ratio{{audit.b0290ae8d0}}list_usd{{audit.602e9ba81d}}{{audit.f48bd051aa}}
{{audit.9fbb6f6864}}
{{audit.videoCostNote}}
{{audit.578bfa31a5}}
{{keys.c4c626646e}}
{{account.0168fbcaa9}}
{{clients.desc}}
{{overview.billingTimezone}}
{{account.retention_intro}}
{{account.retention_reasons}}
{{account.retention_excluded}}
{{keys.6a1b6266d9}}
{{keys.3c53d0fa07}}
{{keys.f2f10a08b4}}
{{keys.d1f23fe857}}
{{keys.9695619d99}}
{{keys.1801907159}}
{{keys.35b0e593b1}}