Build with Spinda
Use the Spinda API
Choose an option. Check a condition. Score against a rubric. Send the current state and named questions; read the answer and probabilities in your code.
Make your first request
- Request access. Once approved, sign in and create an organization.
- Create an API key in the console. Copy it when it is shown and store it as a server-side environment variable named
SPINDA_API_KEY. - Send a JSON request to
https://api.spinda.ai/v1/systemone.
Keep your key on your server. Browser applications should call your own backend, which can authenticate users before calling Spinda.
curl https://api.spinda.ai/v1/systemone \
-H "Authorization: Bearer $SPINDA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "decision-model-small",
"state": "A customer was charged twice.",
"questions": {
"team": {
"type": "choice",
"instructions": "Which team should help?",
"criteria": {
"billing": "Payments and invoices",
"technical": "Product issues"
}
}
}
}'Read each named answer from response.answers. This illustrative excerpt shows the shape of a choice answer; actual probabilities vary.
{
"answers": {
"team": {
"type": "choice",
"choice": "billing",
"probabilities": {"billing": 0.94, "technical": 0.06},
"confidence": 0.88
}
}
}Probability estimates are not guarantees. Evaluate the model on representative examples, and choose thresholds appropriate to the decisions your software makes.
Choices, conditions, and scores
Each question has a type, instructions, and criteria. Mix question types in a single request under distinct names.
| Type | Criteria | Answer |
|---|---|---|
choice | An object mapping option names to descriptions. | The chosen name, probabilities for every option, and confidence. |
Yes/no probabilitynoul | Optional descriptions for true and false. | noul, the probability of true, from 0 to 1. |
score | An ordered list of rubric descriptions, from lowest to highest. | An expected score, probabilities for each level, confidence, and a legend. Levels are indexed from 0. |
For example, a score rubric ["Unrelated", "Tangential", "Partially useful", "Directly useful"] produces an expected score between 0 and 3. It can be fractional.
Requests support up to 64 named questions, 255 choices per question, and a 1 MiB JSON body. The rendered state is limited to 49,152 characters. A 24,000-token padded row budget also applies: the longest rendered question row multiplied by the number of questions. This is not a blanket context-window guarantee; shorten the state or split questions when a request is too large.
Models and pricing
Model inference is currently unavailable. All three models use the same request format. Call GET https://api.spinda.ai/v1/models to inspect model IDs, pricing, and image capabilities. Check GET /health for current model readiness.
| Model ID | USD / 1M input tokens |
|---|---|
decision-model-tiny | $0.021 |
decision-model-small | $0.042 |
decision-model-large | $0.084 |
Input tokens include the formatted state, instructions, criteria, and decision delimiters. The shared state is counted once per request. Output is free. Failed requests are not charged.
Your initial organization receives a $50 usage allowance. Usage pauses when the remaining allowance cannot cover a request. Payment collection is not enabled, and there are no automatic charges. Manage organization members, keys, and usage in the console.
Errors and retries
For each logical request, generate a unique Idempotency-Key header, such as a UUID. Reuse that key and the same body when retrying within 24 hours to avoid paying twice. Use a new key for a different request.
| Status | What to do |
|---|---|
| 401 / 403 | Check the API key and organization access. |
| 402 | The organization’s available allowance cannot cover this request. |
| 409 | Read the error. If the same request is still running, wait and retry. If the key was used with a different body, use a new key. |
| 413 / 422 | Reduce the request size or correct the request format. |
| 429 | Reduce concurrency and retry with backoff. Honor Retry-After when present. |
| 503 / 504 | The model is unavailable or timed out. Retry with backoff and the same idempotency key. |
Keep at most four requests in flight per organization. Use bounded retries with increasing delays and jitter. Save the x-typesafe-request-id response header when troubleshooting a request.
Image input
Image input is currently unavailable. When an image-capable model becomes available, check GET /v1/models for its capabilities. Add one still image in the top-level image field as an inline data URL, such as data:image/png;base64,….
PNG, JPEG, and WebP are supported, up to one megapixel and 2,048 pixels on either side. The entire request must still fit 1 MiB. Remote image URLs and animated images are rejected. Expanded image tokens are included in input usage.
Data handling
The inference cluster is in Texas, United States. Content is processed to provide and operate the service, prevent abuse, and meet legal obligations. We do not train models on your content without prior consent. Derived operational telemetry may be used to improve the service.
The gateway provides a 24-hour replay window for encrypted responses, followed by background cleanup of active records. Cleanup timing and storage remnants are described in the Privacy Policy. Usage records contain metadata rather than your state or questions. Model caches are isolated per request and evicted as capacity is reused; there is no fixed wall-clock eviction guarantee. This is not a zero-retention service.
WorkOS handles sign-in and account identity. Cloudflare provides public HTTPS ingress. These services process the data needed to provide their functions.
Read the Privacy Policy for retention details and privacy requests, and the Terms of Service for account and API use.