Skip to main content
POST
/
api
/
graphs
/
completions
from synth_ai.sdk.graphs import GraphCompletionClient

client = GraphCompletionClient()

result = await client.complete(
    job_id="graph_gen_abc123",
    input={"question": "What is the capital of France?"}
)

print(result.output)  # {"answer": "Paris"}
{
  "output": {
    "answer": "Paris"
  },
  "usage": {
    "prompt_tokens": 1024,
    "completion_tokens": 256,
    "total_tokens": 1280
  },
  "metadata": {
    "latency_ms": 342,
    "model": "gpt-4o-mini"
  }
}
Execute a trained graph or built-in graph for inference.
Use zero_shot_rlm_single for long-context tasks that exceed standard context windows.
job_id
string
required
Graph job ID (e.g., graph_gen_abc123) or built-in graph ID (e.g., zero_shot_rlm_single).
input
object
Input payload for policy graphs.
trace
object
V3 trace payload for verifier graphs.
rubric
object
Rubric payload for verifier graphs.
model
string
Override the policy model for this call.
calibration_examples
array
Optional few-shot examples for calibration.
from synth_ai.sdk.graphs import GraphCompletionClient

client = GraphCompletionClient()

result = await client.complete(
    job_id="graph_gen_abc123",
    input={"question": "What is the capital of France?"}
)

print(result.output)  # {"answer": "Paris"}
{
  "output": {
    "answer": "Paris"
  },
  "usage": {
    "prompt_tokens": 1024,
    "completion_tokens": 256,
    "total_tokens": 1280
  },
  "metadata": {
    "latency_ms": 342,
    "model": "gpt-4o-mini"
  }
}

Policy Graph Example

Request
{
  "job_id": "graph_gen_abc123",
  "input": {
    "question": "What is the capital of France?"
  }
}

RLM Graph Example

Use the built-in RLM graph for long-context inference:
Request
{
  "job_id": "zero_shot_rlm_single",
  "input": {
    "query": "Analyze this log for anomalies.",
    "context": "...(large context)...",
    "system_prompt": "You are a security researcher..."
  }
}

Built-in Graphs

Graph IDDescription
zero_shot_rlm_singleRLM policy graph for long-context tasks
zero_shot_verifier_rubricBasic verifier graph
zero_shot_verifier_rubric_rlmRLM-powered verifier graph

Verifier Graphs

For verifier-specific graphs that score traces against rubrics, see the Verifier API.