Browse the API reference

Auto-select Operator for Query

post/v1/graphs/{graph_id}/operator

Part of Operator.

Routes to the best operator for your query. Operators: analyst (answers natural-language questions over the graph — curated financial reads, documents, memory, and read-only Cypher; supports quick, standard, extended; cypher is accepted as its former name) and mapping (autonomous Chart of Accounts → rs-gaap mapping; roboledger graphs only, extended only). GET /v1/graphs/{graph_id}/operator lists what is registered. Credits are consumed by actual token usage, not a fixed price per mode. The run executes on the background worker: the default answer is 202 with the operation's _links (stream, status, cancel); ?mode=sync waits up to 50s and answers 200 with the result.

Authentication

Authenticate in any one of these ways — not all of them:

  • API key in the X-API-Key header.
  • Bearer token in the Authorization header.

Path parameters

NameTypeDescription
graph_idrequiredstringGraph Id

Query parameters

NameTypeDescription
modeoptionalResponseMode`sync` waits up to 50s for the answer and returns 200 with it (202 with the operation links if the worker is still busy). Anything else — `async`, `stream`, `auto` or unset — queues the run and returns 202; follow `_links.stream` for progress and the result.

One of: auto, sync, async, stream

Request body

Required, application/json.

FieldTypeDescription
messagerequiredstring

The query or message to process

historyoptionalOperatorMessage[]

Conversation history

OperatorMessage fields
FieldTypeDescription
rolerequiredstring

Message role (user/assistant)

contentrequiredstring

Message content

timestampoptionalstring (date-time)

Message timestamp

contextoptionalobject

Additional context for analysis (e.g., enable_rag, include_schema)

modeoptionalOperatorMode

Execution mode

One of: quick, standard, extended, streaming

Default: standard

operator_typeoptionalstring

Specific operator type to use (optional)

selection_criteriaoptionalSelectionCriteria

Criteria for operator selection

SelectionCriteria fields
FieldTypeDescription
min_confidenceoptionalnumber

Minimum confidence score

Default: 0.3

required_capabilitiesoptionalstring[]

Required operator capabilities

preferred_modeoptionalOperatorMode

Preferred execution mode

One of: quick, standard, extended, streaming

max_response_timeoptionalnumber

Maximum response time in seconds

Default: 60

excluded_operatorsoptionalstring[]

Operators to exclude from selection

force_extended_analysisoptionalboolean

Force extended analysis mode with comprehensive research

Default: false

enable_ragoptionalboolean

Enable RAG context enrichment

Default: true

streamoptionalboolean

Enable streaming response

Default: false

max_creditsoptionalnumber

Per-question credit ceiling. Once the run's consumed credits reach this number, no further tool step starts and the operator answers from what it has (the wrap-up itself may carry the total slightly past the ceiling). Omit for the mode's default step-bounded behavior.

Example request

curl
curl -X POST "https://api.robosystems.ai/v1/graphs/{graph_id}/operator" \
  -H "X-API-Key: $ROBOSYSTEMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "enable_rag": true,
  "message": "What was Apple'\''s revenue in Q4 2023?"
}'

Responses

200 Successful Response

FieldTypeDescription
contentrequiredstring

The operator's response content

operator_usedrequiredstring

The operator type that handled the request

mode_usedrequiredOperatorMode

The execution mode used

One of: quick, standard, extended, streaming

metadataoptionalobject

Response metadata including routing info

tokens_usedoptionalobject

Token usage statistics

confidence_scoreoptionalnumber

Confidence score of the response (0.0-1.0 scale)

operation_idoptionalstring

Operation ID for SSE monitoring

is_partialoptionalboolean

Whether this is a partial response

Default: false

error_detailsoptionalobject

Error details if any

execution_timeoptionalnumber

Execution time in seconds

timestampoptionalstring (date-time)

Response timestamp

StatusMeaning
202Run queued on the worker — follow `_links.stream`
400Invalid request
401Authentication required
402Insufficient credits
403Access denied
404Resource not found
422Validation Error
429Rate limit exceeded
500Internal server error