Drex guides

Drex Max

Call Drex Max and Drex Max Finance, the multimodal Drex models, with text or images, and the limits that differ from the other models.

Drex Max is a multimodal decision model and the most accurate Drex: it reads text and images. Drex Max Finance is a multimodal decision model for finance with the same request. They take the same request as every other model on POST /v1/systemone and return the same answer format. This page covers what differs: how to select them, their limits, and image inputs. For the request itself, see Questions and State.

Select Drex Max

Send drex-max-v1.1 for Drex Max v1.1, or the finance model's id from Models. These are separate models with separate serving capacity. The original Max id remains accepted and routes to Max v1.1; the response reports the successor's id and billing uses its price. The latest alias does not point to a Max model, and a request that omits model is answered by drex-v2.0. Authentication, rate limits and billing are the same as for every model. Drex Max v1.1 costs $0.03 per million input tokens; output tokens are not billed.

curl https://console.nace.ai/v1/systemone \
  -H "Authorization: Bearer $NACE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "drex-max-v1.1",
    "state": "My parcel arrived with the box crushed and the lamp inside cracked. I want a new one.",
    "questions": {
      "damaged": { "type": "noul", "instructions": "Did the item arrive damaged?" },
      "intent": {
        "type": "choice",
        "instructions": "What does the customer want?",
        "criteria": { "refund": "Money back", "replace": "A new item", "info": "Information only" }
      }
    }
  }'

The response has the usual shape: model is drex-max-v1.1, answers is an object keyed by the question ids you supplied, and usage, evaluation_time_ms and request_id are present. See Reading answers.

Drex Max Finance

drex-max-finance is a multimodal decision model for finance with its own serving capacity. Send its id as model, with the same questions and images as Drex Max. It reads text and PNG, JPEG or WebP images. Models lists its current input-token price and limit; output tokens are not billed. The limits below explain input accounting.

Before running the example, call GET /v1/models with the same API key and base URL and check for drex-max-finance. Availability can differ by environment. An unavailable model returns 422 invalid_request_error with issue path model; see Models.

curl https://console.nace.ai/v1/systemone \
  -H "Authorization: Bearer $NACE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "drex-max-finance",
    "state": "Invoice 4471 from Northwind Ltd. Total due 12,480.00 USD, net 30 days. Purchase order PO-9921 approved for 11,900.00 USD.",
    "questions": {
      "over_po": { "type": "noul", "instructions": "Does the invoice total exceed the approved purchase order amount?" },
      "action": {
        "type": "choice",
        "instructions": "How should accounts payable handle this invoice?",
        "criteria": { "pay": "Pay as invoiced", "hold": "Hold for review", "reject": "Reject" }
      }
    }
  }'

The response has model set to drex-max-finance and an answers object keyed by the question ids you supplied (over_po and action in this example). See Reading answers.

Limits

LimitText onlyWith images
Questions per request512512
Options per choice or levels per score question255255
Serialized body4 MiB4 MiB, including inline images
Images per requestNone8

The models have different token limits; see the model rows on Limits for their current values.

For both served Max models, the token limit applies to the whole packed request: the shared state and images, all questions, and the model's formatting and decision markers. Adding a question consumes this shared budget, even when that question would fit on its own. Requests using a retired model id follow these same successor limits.

None of these Max models falls back to another. These limits decide whether the request is admitted; they do not guarantee an answer within the evaluate timeout, so send fewer questions with very long states. Over a limit, the response is 422 invalid_request_error with a message that names it. When the model does not answer within the evaluate timeout, the response is 529 overloaded. The Limits page also has the body limit, rate limits and timeouts every model shares.

Images

Drex Max v1.1 and Drex Max Finance read images. Requests using retired ids also accept images when they resolve to Max v1.1; see Retired models. Add an images array to the request. Every question sees the same images, in array order, before the state and the questions. Refer to them as "Image 1", "Image 2" and so on in the state or the instructions. Those words stay plain text: Drex inserts nothing where they appear, and the model matches them to the images by their order in the array. A URL in the request is text too; Drex never fetches it.

Each images entry is either an uploaded file or the image's bytes inline. You can mix the two in one request. Keep images out of state and questions: media placed there returns 422.

Uploaded files

Upload the image with the direct upload flow, leaving out workspace_id. Wait for the upload job to succeed, then name the file with the workspace_id and file_id it returns:

Request
{
	"model": "drex-max-v1.1",
	"state": "Inspect Image 1.",
	"images": [
		{ "type": "workspace_file", "workspace_id": "YOUR_WORKSPACE_ID", "file_id": "YOUR_FILE_ID" }
	],
	"questions": {
		"receipt": { "type": "noul", "instructions": "Is Image 1 a purchase receipt?" }
	}
}

The file must be one you uploaded without a workspace, with the account that owns your API key. A file in one of your Workspaces, or in another account's, returns 422. Uploaded files keep the request small, so use them for anything but small images. Uploads are free, and an ordinary account keeps the file until explicit deletion.

Inline images

An entry can instead be a standard base64 string or a data URL such as data:image/jpeg;base64,...:

Request
{
	"model": "drex-max-v1.1",
	"state": "Inspect Image 1.",
	"images": ["data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ..."],
	"questions": {
		"receipt": { "type": "noul", "instructions": "Is Image 1 a purchase receipt?" }
	}
}

Inline images count toward the 4 MiB body limit, base64 expansion included, so a request holds about 3 MiB of inline image bytes in all. Upload larger images, or downscale them before you send them.

Multipart upload

The TypeSafe clients send images as a multipart/form-data request, and POST /v1/systemone takes that form too. It is the same request as the JSON one. Drex reads it into a JSON body with an images array, so the limits, billing and errors below apply unchanged.

The form has a request part that holds the JSON body, and one file part per image. The body's assets field gives each image a name and says which part holds its bytes:

POST /v1/systemone
Content-Type: multipart/form-data; boundary=...

--...
Content-Disposition: form-data; name="request"; filename="request.json"
Content-Type: application/json

{"model":"drex-max-v1.1","state":"Inspect the image.\nreceipt-1","assets":{"receipt-1":{"type":"image","part":"image-1"}},"questions":{"receipt":{"type":"noul","instructions":"Is this a receipt?"}}}
--...
Content-Disposition: form-data; name="image-1"; filename="image-1.png"
Content-Type: image/png

<PNG bytes>
--...--
  • Order: assets lists the images in order. The first is Image 1, the second Image 2.
  • References: each asset name that appears in state, in a question's instructions, or in a criteria description becomes "Image N" before the model reads it. Choose names that cannot appear in your text by accident; the AI SDK and the TypeSafe SDKs generate such names.
  • Formats: PNG and JPEG only. Drex checks the bytes, not the type the part declares. A WebP or GIF returns 422 with path assets.<name>.
  • Size: the whole body, image bytes included, is at most 4 MiB. A multipart body holds about 3 MiB of image bytes, because Drex bills and checks the base64 form. For larger images, send JSON with workspace_file entries; a multipart request cannot also carry an images array.
  • Header: TypeSafe-Danger-Zone-Images: true, which the clients send, is accepted and not required.
  • Models: Drex Max v1.1 and Drex Max Finance, including retired ids that resolve to Max v1.1. Another model returns 422 with path images, as it does for JSON.

Multipart upload errors lists the messages for a malformed form.

Image limits

LimitValue
FormatsPNG, JPEG or WebP
Images per request8
Bytes per image16 MiB
Bytes for all images in a request32 MiB
Input pixels per image40 million
Request body, inline images included4 MiB

Drex fetches and checks uploaded files before it calls the model, within 20 seconds per request.

Drex Max resizes each image to at most 1,638,400 pixels (the area of 1,280 × 1,280), so detail past that is not kept. Image tokens count toward the token limits above: in the shared packed request for Max v1.1 and Max Finance. A long state with several images and many questions can therefore be refused with a 422 even when each question fits on its own; send fewer questions per request.

An image that is invalid, corrupt, too large, in another format, or a file you can't use returns 422 with path images.<index>. Images sent to any other model return 422 with path images and the message images require drex-max-v1.1 or drex-max-finance. When image storage or image inference is briefly unavailable, or fetching the images takes longer than 20 seconds, the response is 529 overloaded; retry it. A request that fails is not billed. Errors lists every image message.

Image usage

Responses to image requests can include usage.image_tokens, the tokens the images took. They are already included in usage.input_tokens, which is what you are billed for.

On this page