Auto
Let Thrixel choose between Architect and Sculptor for a prompt.
Auto is two calls: route, then submit. Routing only suggests an engine. Nothing is generated until you submit, and nothing is charged until a submit uses the route.
Choose an engine
POST /api/v1/route
Requires API key.
Request Body
| Name | Type | Description |
|---|---|---|
task | string | The prompt you are about to submit. Up to 8,000 characters. |
images | string[] | Reference images as data URLs. Up to 6; the first 3 are looked at. |
image | string | Single-image alias for images. |
Provide task, an image, or both. Send the same inputs you will submit, so the
suggestion describes the request you actually make.
Example Request
curl -X POST https://api.thrixel.com/api/v1/route \
-H "Authorization: Bearer sk-thrixel-<YOUR_KEY>" \
-H "Content-Type: application/json" \
-d '{
"task": "a wooden treasure chest with a hinged lid"
}'Example Response
Response Fields
| Name | Type | Description |
|---|---|---|
route_id | string | null | Pass it back as auto_route_id on the submit. Null when no suggestion could be made. |
engine | string | null | architect or sculptor. Null when no suggestion could be made. |
confidence | number | 0 to 1. How sure the suggestion is. |
reason_code | string | null | Why this engine, from the list below. |
ask_user | boolean | true when the suggestion is not confident enough to follow on its own. Show the user both engines and let them pick. |
cubes | integer | What the route costs when a submit uses it. 0 when there is no route. |
When engine is null, ask_user is true and nothing is owed: let the user
pick the engine and submit without auto_route_id.
Reason codes
| Code | Suggests | Meaning |
|---|---|---|
moving_parts | Architect | Part of it needs to move on its own (a lid, a wheel, a door). |
multi_part | Architect | Separate, editable parts were asked for. |
scene | Architect | Several objects laid out together. |
hard_surface | Architect | A man-made object with clean edges and exact proportions. |
furniture_vehicle_building | Architect | Furniture, vehicles and buildings build best from separate parts. |
lowpoly_style | Architect | A low-poly, voxel or blocky style. |
product_photo | Architect | The image shows a man-made object. |
organic_single | Sculptor | An organic subject in one piece: a creature, character, plant or rock. |
organic_photo | Sculptor | The image shows an organic subject. |
one_piece_request | Sculptor | A single fused piece was asked for. |
New codes may be added. Treat an unknown code as "no reason given" rather than as an error.
Submit with the route
Submit to the engine you settled on, Architect or Sculptor, exactly as you would without Auto, and add one field:
| Name | Type | Description |
|---|---|---|
auto_route_id | string | The route_id from /route. Records that Auto made the choice and charges the route. |
curl -X POST https://api.thrixel.com/api/v1/architect/submit \
-H "Authorization: Bearer sk-thrixel-<YOUR_KEY>" \
-H "Content-Type: application/json" \
-d '{
"task": "a wooden treasure chest with a hinged lid",
"auto_route_id": "0b1c2d3e-..."
}'You may submit to the other engine than the one suggested. The route is
still used and charged, and the submission records both the suggestion and
what you chose: GET /{submission_id}/info returns them to you as
auto_route.engine and auto_route.chosen_engine.
Rules for a route id
A route id is single-use, belongs to the account that asked for it, and
expires after 30 minutes. A submit carrying one that is unknown, already
used or expired is refused with 400 before anything is created or charged.
Ask /route again with the current prompt.
Cost
A route costs 1 Cube (the exact amount is in the cubes field), charged
only when a submit uses it. A route you never submit costs nothing. The submission itself is priced as usual for its engine.
The route's Cube shows in your billing activity under Auto.
Errors
| Status | When |
|---|---|
402 | Your Cube balance is empty. Top up before routing, since you could not submit either. |
422 | Neither task nor an image was sent, or more than 6 images. |
429 | Too many routes requested without a submit (30 unused within 30 minutes). Submit one, or wait a few minutes. |
A routing outage never fails the call: it returns engine: null and
ask_user: true, so you can still let the user choose.