How to Submit Task
Submit generation tasks to Get3W models via API.
Endpoint
POST https://api.get3w.com/api/v3/{model-id}Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer YOUR_API_KEY |
Content-Type | Yes | application/json |
Request Format
bash
curl -X POST 'https://api.get3w.com/api/v3/get3w/flux-dev' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "A cat wearing a space suit"
}'python
import os
import requests
api_key = os.environ.get("GET3W_API_KEY")
response = requests.post(
"https://api.get3w.com/api/v3/get3w/flux-dev",
headers={
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
},
json={
"prompt": "A cat wearing a space suit"
}
)
task = response.json()["data"]
task_id = task["id"]
print(f"Task submitted: {task_id}")javascript
const response = await fetch("https://api.get3w.com/api/v3/get3w/flux-dev", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.GET3W_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
prompt: "A cat wearing a space suit"
})
});
const { data } = await response.json();
console.log(`Task submitted: ${data.id}`);Request Body
The request body varies by model. Common parameters:
| Parameter | Type | Description |
|---|---|---|
prompt | string | Text description |
width | integer | Output width |
height | integer | Output height |
seed | integer | Random seed |
webhook_url | string | Callback URL |
Check the model's documentation for specific parameters.
Response
json
{
"code": 200,
"message": "success",
"data": {
"id": "pred_abc123",
"model": "get3w/flux-dev",
"status": "created",
"urls": {
"get": "https://api.get3w.com/api/v3/predictions/pred_abc123"
},
"created_at": "2024-01-01T12:00:00.000Z"
}
}Response Fields
| Field | Description |
|---|---|
data.id | Task ID for polling |
data.status | Initial status (created) |
data.urls.get | URL to check status |
With Webhook
Receive notification when complete:
bash
curl -X POST 'https://api.get3w.com/api/v3/get3w/flux-dev' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "A cat in space",
"webhook_url": "https://your-server.com/webhook"
}'Error Responses
| Code | Description |
|---|---|
| 400 | Invalid parameters |
| 401 | Invalid API key |
| 403 | Account issue |
| 429 | Rate limit exceeded |
| 500 | Server error |
Next Steps
After submitting, use How to Get Result to retrieve your output.