页面简介
Send a state and a set of typed questions to POST /inference/v1/systemone and get a calibrated probability distribution for every question in one pass.
正文摘录
The System One decisions API takes a state (any text or JSON describing the current situation) and a set of typed questions, and returns a calibrated probability distribution for every question. The model reads the state once and answers every question from that single pass, so adding questions to a request is much cheaper than making separate calls. The same API is also available in an OpenAI-compatible shape at POST /inference/v1/decisions. Endpoint POST https://api.fireworks.ai/inference/v1/systemone Authenticate with your normal Fireworks API key. Set model to the System One model path. The public Serverless model is accounts/fireworks/models/rune, which serves this API and the Decisions API only; chat completions and completions against it return a 400. Other models that don’t support this API also return a 400. Quickstart cURLPythoncurl https://api.fireworks.ai/inference/v1/systemone \ -H "Authorization: Bearer $FIREWORKS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "accounts/<your-account>/models/<your-model>", "state": { "user_request": "Add retry with exponential backoff to the payments webhook handler, and don'\''t retry on 4xx.", "last_command": "npm test -- webhooks", "test_output": "PASS handler.test.ts (4 tests)\nFAIL retry.test.ts\n x does not retry on 4xx responses\n Expected forwardEvent to be called 1 time, received 5" }, "questions": { "task_complete": { "type": "noul", "instructions": "Is the user'\''s request fully done?" }, "next_action": { "type": "choice", "instructions": "What should the agent do next?", "criteria": { "edit_code": "Change the code to fix the failing behavior", "rerun_tests": "Run the tests again without changing anything", "ask_user": "Stop and ask the user a clarifying question", "finish": "Report the task as done" } }, "risk": { "type": "score", "instructions": "How risky would it be to ship the current change as is?", "criteria": ["safe", "minor risk", "moderate risk", "high risk", "would cause an incident"] } } }' Request FieldTypeDescriptionmodelstringRequired. The System One model path, for example accounts/<your-account>/models/<your-model>.statestring or objectRequired. The situation to decide about. Strings are used as-is; objects are serialized as JSON.questionsobjectRequired. Map of your question ID to a question. Up to 256 questions per request. Question types typecriteriaAnswernoulOptional object {"true": "...", "false": "..."} describing each side. Defaults to yes/no.Probability that the statement is true.choiceRequired. Object mapping each option key to a description. Up to 208 options.The most likely option, a probability per option, and a confidence.scoreRequired. Ordered array of 2 to 10 level descriptions, lowest first.The expected score (0 = first level), a probability per level, and a confidence. Every question takes an instructions string: the question itself, in plain language. Response { "model": "accounts/<your-account>/models/<your-model>", "answers": { "refund": { "type": "noul", "noul": 0.98 }, "tone": { "type": "choice", "choice": "angry", "probabilities": { "angry": 0.91, "neutral": 0.08, "positive": 0.01 }, "confidence": 0.87 }, "urgency": { "type": "score", "score": 1.7, "legend": { "0": "not urgent", "1": "somewhat urgent", "2": "urgent", "3": "critical" }, "probabilities": { "0": 0.05, "1": 0.3, "2": 0.55, "3": 0.1 }, "confidence": 0.4 } }, "usage": { "input_tokens": 212, "cached_input_tokens": 0, "output_tokens": 0 } } Values above are illustrative. FieldDescriptionnoulProbability, from 0 to 1, that the statement is true.choiceThe key of the most likely option.scoreExpected level, from 0 to the number of levels minus 1, weighted by probability.probabilitiesProbability of each option key (choice) or level index (score). Sums to 1.confidenceHow concentrated the distribution is: 0 when every option is equally likely, 1 when one option has all the probability.legendFor score, maps each level index back to its description.usageToken usage for the request. cached_input_tokens counts state tokens served from the prompt cache. Pricing and capacity Billing, capacity, and rate limits depend on how the model is deployed. Serverless. Rune is billed per input token on Serverless pricing. Output tokens are always zero. Capacity and rate limits work the same as for other Serverless models; see Serverless rate limits. Dedicated deployment. Usage is billed at the deployment’s standard on-demand GPU rate, and capacity scales with the deployment’s size and autoscaling settings. Latency and caching Batch your questions. All questions in a request share one read of the state, so asking ten questions in one request is much faster and cheaper than ten requests. Reuse the state. The state is cached across requests and the questions are not. Calls that send the same large state (for example a long transcript) with different questions benefit most from caching. Measure server time. The fireworks-server-processing-time response header reports time spent on Fireworks servers. Anything above that is network. Limits LimitValueQuestions per request256Options per choice question208Levels per score question2 to 10Context window256K tokensQuestion text16K tokensState size4 MiBRequest body8 MiBRequest duration5 minutes Current support: Text only. Requests with images return a 400. No reasoning. reasoning_effort other than "none" returns a 400. Decisions only. The model serves /inference/v1/systemone and /inference/v1/decisions only. Chat completions and completions against it return a 400. Errors Errors use the standard Fireworks error body. StatusMeaning400Over a limit, an unsupported field, or a model that doesn’t support this API.413Request body over 8 MiB.422Malformed JSON, a missing required field, or an invalid question (unknown type or malformed criteria).429Rate limited. Retry after the Retry-After header.503Temporarily at capacity. Retry after the Retry-After header.504The request took longer than 5 minutes.502Upstream failure. Safe to retry.Was this page helpful?YesNo⌘I