Skip to main content

1. Create an account

Sign up in the console with your email address. We send you a sign-in link; open it to verify your email and sign in. There is no password.

2. Add credit

The API draws from a prepaid USD balance, and a request needs enough balance to run. Card top-ups in the console are not available yet: to add credit, contact us at contact@torchcast.ai. See Billing.

3. Create an API key

In the console, open API keys and choose Create key. Copy the key when it is shown: it is displayed only once. Decision API keys start with tcd_. Keys from the Torchcast app (tc_) do not work here. Store the key in an environment variable:

4. Make a request

This request asks two questions about a support email: whether the customer wants a refund (a yes/no noul question) and which team should handle it (a choice question).
torchcast-decider-latest always points at the newest stable model. To pin a version, use a pinned id from GET /v1/models.

5. Read the answer

Response
  • answers.refund_request.noul is the probability that the answer is yes: here 0.97.
  • answers.team.choice is the most likely option, and probabilities gives every option’s probability.
  • model is the pinned model that answered, even though the request named the alias. Log it with your results.
  • usage.input_tokens is what you are charged for. Every response also carries an x-request-id header; quote it if you contact support.
The model id in this example is illustrative; your response names the model that actually answered. Turn probabilities into actions with a threshold that fits the cost of a mistake in your application:

Next steps

Concepts

All three question types, including score.

Errors

Every error and what to do about it.