Skip to content

How to Submit Task

Submit generation tasks to Get3W models via API.

Endpoint

POST https://api.get3w.com/api/v3/{model-id}

Headers

HeaderRequiredDescription
AuthorizationYesBearer YOUR_API_KEY
Content-TypeYesapplication/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:

ParameterTypeDescription
promptstringText description
widthintegerOutput width
heightintegerOutput height
seedintegerRandom seed
webhook_urlstringCallback 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

FieldDescription
data.idTask ID for polling
data.statusInitial status (created)
data.urls.getURL 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

CodeDescription
400Invalid parameters
401Invalid API key
403Account issue
429Rate limit exceeded
500Server error

Next Steps

After submitting, use How to Get Result to retrieve your output.

Released under the MIT License.