TRIVERSE Docs
API Endpoints

Pricing Quote

Use the pricing quote endpoint before creating a task when you want to know how many API credits the task will cost and whether the authenticated API user currently has enough available API credits.

The endpoint is a read-only preflight check. It does not create a task, freeze credits, dispatch Prefect, enqueue work, run content moderation, or guarantee that a later task creation request will pass final validation.

Quote Task Credits

Endpoint

POST /tasks/pricing/quote

Authentication

Required (Bearer Token)

Request Body

FieldTypeRequiredDescription
flow_nameStringYesPublic flow name to quote, such as image-generation, image-to-model, or model-remesh. The camelCase alias flowName is also accepted.
paramsObjectNoPricing parameters. You only need to pass fields that affect price. Execution-only fields such as prompt, image_file, model_file, and model_url are not required for quoting.
surfaceStringNoAccepted for callers copying Web quote payloads, but ignored. API quotes always use the API pricing surface.

Response Body

POST /api/v1/tasks/pricing/quote returns StandardResponse<PublicTaskPricingQuotePayload>.

FieldTypeDescription
flow_nameStringThe quoted public flow name.
paramsObjectPublic normalized pricing parameters actually used by the API quote. This is not a raw echo of the request.
cost_creditsIntegerEstimated API credits required for the normalized flow and pricing parameters.
available_creditsIntegerCurrent available API credits for the authenticated API user.

Use available_credits >= cost_credits to decide whether the user has enough API credits. The endpoint intentionally does not return can_execute, missing_credits, queue state, pricing manifest, pricing key, or pricing breakdown.

Pricing Parameter Rules

  • Pass only price-affecting fields when possible.
  • Fields not registered as price-affecting are ignored and are not returned in data.params.
  • Internal fields are ignored and never returned, including pricing_snapshot, _analytics_context, request_payload, provider_model_id, user_id, task_id, client_order_id, and allow_duplicate.
  • flowName, aiModel, imageCount, and qualityMode are accepted for compatibility. The public response uses snake_case.
  • surface cannot force Web pricing. This endpoint always calculates API pricing.

Supported Quote Parameters

FlowPricing params to sendDefaults and allowed valuesAPI priceResponse params
image-generationai_model, image_countai_model defaults to seedream_4_5. Supported values: seedream_4_0, seedream_4_5, seedream_5_0_lite. image_count defaults to 4 and supports 1-10 for API.Model unit credits x image countai_model, image_count
image-to-modelturbo or qualityModeDefault turbo=false / qualityMode=quality. Speed mode: turbo=true or qualityMode=speed.quality 35, speed 25turbo
multiview-to-modelturbo or qualityModeSame as image-to-model.quality 35, speed 25turbo
image-to-meshturbo or qualityModeSame as image-to-model.quality 25, speed 15turbo
multiview-to-meshturbo or qualityModeSame as image-to-model.quality 25, speed 15turbo
text-to-modelturbo or qualityModeSame as image-to-model.quality 40, speed 30turbo
text-to-meshturbo or qualityModeSame as image-to-model.quality 30, speed 20turbo
texture-modelNoneFixed price.10{}
text-to-textureNoneFixed price.15{}
convert-model-formatNoneFixed price.1{}
model-preview-renderNoneFixed price.1{}
model-remeshNoneFree task.0{}
prompt-optimizeNoneFree task.0{}

Price-neutral fields such as model_version, polygon_limit, texture_size, target_face_count, face_type, render_mode, and resolution may be present if you copy a full task creation payload, but they do not affect V1 pricing and are not returned in quote params.

Example: Image Generation

cURL

curl -X 'POST' \
  'https://api.triverse.ai/api/v1/tasks/pricing/quote' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer <YOUR_API_KEY>' \
  -H 'Content-Type: application/json' \
  -d '{
  "flow_name": "image-generation",
  "params": {
    "ai_model": "seedream_4_5",
    "image_count": 4
  }
}'

JavaScript

const response = await fetch(
  "https://api.triverse.ai/api/v1/tasks/pricing/quote",
  {
    method: "POST",
    headers: {
      Accept: "application/json",
      Authorization: "Bearer <YOUR_API_KEY>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      flow_name: "image-generation",
      params: {
        ai_model: "seedream_4_5",
        image_count: 4,
      },
    }),
  },
);
const data = await response.json();
console.log(data);

Python

import requests

response = requests.post(
    "https://api.triverse.ai/api/v1/tasks/pricing/quote",
    headers={
        "Accept": "application/json",
        "Authorization": "Bearer <YOUR_API_KEY>",
    },
    json={
        "flow_name": "image-generation",
        "params": {
            "ai_model": "seedream_4_5",
            "image_count": 4,
        },
    },
)
print(response.json())

Response

{
  "code": 0,
  "message": "success",
  "data": {
    "flow_name": "image-generation",
    "params": {
      "ai_model": "seedream_4_5",
      "image_count": 4
    },
    "cost_credits": 16,
    "available_credits": 120
  }
}

Example: Image Generation With CamelCase Input

{
  "flowName": "image-generation",
  "params": {
    "aiModel": "seedream_4_5",
    "imageCount": 4
  },
  "surface": "api"
}

The response still uses public snake_case fields:

{
  "code": 0,
  "message": "success",
  "data": {
    "flow_name": "image-generation",
    "params": {
      "ai_model": "seedream_4_5",
      "image_count": 4
    },
    "cost_credits": 16,
    "available_credits": 120
  }
}

Example: Image To Model Quality Mode

Omitting params or passing turbo=false uses the quality price.

{
  "flow_name": "image-to-model",
  "params": {
    "turbo": false
  }
}
{
  "code": 0,
  "message": "success",
  "data": {
    "flow_name": "image-to-model",
    "params": {
      "turbo": false
    },
    "cost_credits": 35,
    "available_credits": 120
  }
}

Example: Image To Model Speed Mode

{
  "flow_name": "image-to-model",
  "params": {
    "qualityMode": "speed"
  }
}
{
  "code": 0,
  "message": "success",
  "data": {
    "flow_name": "image-to-model",
    "params": {
      "turbo": true
    },
    "cost_credits": 25,
    "available_credits": 120
  }
}

Example: Text To Model Speed Mode

{
  "flow_name": "text-to-model",
  "params": {
    "turbo": true
  }
}
{
  "code": 0,
  "message": "success",
  "data": {
    "flow_name": "text-to-model",
    "params": {
      "turbo": true
    },
    "cost_credits": 30,
    "available_credits": 120
  }
}

Example: Fixed-Price Task

texture-model, text-to-texture, convert-model-format, and model-preview-render do not need pricing parameters.

{
  "flow_name": "texture-model",
  "params": {}
}
{
  "code": 0,
  "message": "success",
  "data": {
    "flow_name": "texture-model",
    "params": {},
    "cost_credits": 10,
    "available_credits": 120
  }
}

Example: Free Task

{
  "flow_name": "model-remesh",
  "params": {}
}
{
  "code": 0,
  "message": "success",
  "data": {
    "flow_name": "model-remesh",
    "params": {},
    "cost_credits": 0,
    "available_credits": 120
  }
}

More Flow Examples

This table shows minimal request bodies and the successful data payload. The actual response still includes the outer code and message fields.

FlowMinimal request bodyExample data
multiview-to-model{"flow_name":"multiview-to-model","params":{"turbo":true}}{"flow_name":"multiview-to-model","params":{"turbo":true},"cost_credits":25,"available_credits":120}
image-to-mesh{"flow_name":"image-to-mesh","params":{"turbo":false}}{"flow_name":"image-to-mesh","params":{"turbo":false},"cost_credits":25,"available_credits":120}
multiview-to-mesh{"flow_name":"multiview-to-mesh","params":{"qualityMode":"speed"}}{"flow_name":"multiview-to-mesh","params":{"turbo":true},"cost_credits":15,"available_credits":120}
text-to-mesh{"flow_name":"text-to-mesh","params":{"turbo":true}}{"flow_name":"text-to-mesh","params":{"turbo":true},"cost_credits":20,"available_credits":120}
text-to-texture{"flow_name":"text-to-texture","params":{}}{"flow_name":"text-to-texture","params":{},"cost_credits":15,"available_credits":120}
convert-model-format{"flow_name":"convert-model-format","params":{}}{"flow_name":"convert-model-format","params":{},"cost_credits":1,"available_credits":120}
model-preview-render{"flow_name":"model-preview-render","params":{}}{"flow_name":"model-preview-render","params":{},"cost_credits":1,"available_credits":120}
prompt-optimize{"flow_name":"prompt-optimize","params":{}}{"flow_name":"prompt-optimize","params":{},"cost_credits":0,"available_credits":120}

Example: Full Task Payload Is Safe To Copy

If you copy a task creation payload for convenience, quote extracts only price-affecting fields.

{
  "flow_name": "image-generation",
  "params": {
    "prompt": "a small robot on a desk",
    "ai_model": "seedream_4_5",
    "image_count": 2,
    "pricing_snapshot": {
      "manifestHash": "should-not-be-used"
    },
    "_analytics_context": {
      "client_id": "should-not-be-used"
    },
    "request_payload": {
      "admin": true
    },
    "provider_model_id": "should-not-be-used",
    "user_id": "should-not-be-used"
  }
}
{
  "code": 0,
  "message": "success",
  "data": {
    "flow_name": "image-generation",
    "params": {
      "ai_model": "seedream_4_5",
      "image_count": 2
    },
    "cost_credits": 8,
    "available_credits": 120
  }
}

Error Examples

Invalid pricing parameters return the standard error envelope.

{
  "flow_name": "image-generation",
  "params": {
    "ai_model": "seedream_4_5",
    "image_count": 0
  }
}
{
  "code": 1004,
  "message": "One or more request parameters are invalid.",
  "data": null
}

Unsupported image-generation models return the unsupported model error.

{
  "flow_name": "image-generation",
  "params": {
    "ai_model": "unsupported-model",
    "image_count": 1
  }
}
{
  "code": 2030,
  "message": "The selected AI model is not supported.",
  "data": null
}

For the field contract of the response payload, see Common Response Structures.

On this page