{% extends "base.html" %} {% block title %}Quickstart | {{ app_name }}{% endblock %} {% block body_class %}landing{% endblock %} {% block body %}
{{ app_name }}

Quickstart

Create a first run in a few minutes, then connect your agent. Gemini, OpenAI and Anthropic are supported.

Using Claude Code? The experimental hook integration connects tool activity and pytest reports. It requires the current source package and does not measure model spend.

For an existing command, CLI watch tracks process exits and JUnit reports without changing the agent loop. Enforcement cancels the owned process tree; model spend is not measured.

The local provider proxy adds Chat Completions token usage and estimated-spend checks. One in-flight request can exceed an estimated budget.

1. Get an API key

{% if session %}Create a key{% else %}Create an account, then create a key{% endif %} and set it in your environment:

pip install agent-supra
export AGENT_SUPRA_API_KEY="as_live_…"
export AGENT_SUPRA_URL="{{ base_url }}"

On Windows PowerShell, use $env:AGENT_SUPRA_API_KEY="as_live_…" and $env:AGENT_SUPRA_URL="{{ base_url }}" instead of export.

2. Verify your first run

Save this as first_run.py and run python first_run.py. It needs only your Agent Supra key and should show a completed run in your dashboard.

from agent_supra import Client, SupervisedRun

sup = Client()
task = sup.create_task("First Agent Supra run")
with SupervisedRun(sup, task) as run:
    run.report_tests(["smoke"], [], rev="first-run")
    run.finish("success")
    print("Completed run:", run.run_id)

3. Wrap your agent

Install google-genai and set GEMINI_API_KEY for Gemini. The following is an integration outline: replace prompt, apply_fix, run_tests and git_rev with your agent's own functions. rev should change when the code changes, such as a git commit hash or a hash of edited files. For a runnable end-to-end example, see gemini_agent.py.

from google import genai
from agent_supra import Client, SupervisedRun, SupervisorPaused

sup = Client()
task = sup.create_task("Fix failing checkout tests", budget_usd=3)

with SupervisedRun(sup, task) as run:
    gemini = run.wrap_gemini(genai.Client())
    try:
        while True:
            run.check()                       # stops here once paused
            reply = gemini.models.generate_content(
                model="gemini-3.5-flash-lite", contents=prompt)
            run.tool("edit_file", apply_fix, reply.text, rev=git_rev())
            result = run.tool("run_tests", run_tests, rev=git_rev())
            run.report_tests(result.all_ids, result.failing_ids, rev=git_rev())
            if not result.failing_ids:
                run.finish("success")
                break
    except SupervisorPaused as paused:
        print("Paused:", paused.reason)       # don't retry; review it in the dashboard

4. Watch it in observation mode

New workspaces start in observation mode: runs are flagged, never paused, while you check the flags are right. Budgets and call caps are enforced from the start. When you trust the rules, turn observation mode off in Settings and add a Slack webhook so you hear about pauses.

Other model clients

# OpenAI (also works for Gemini's OpenAI-compatible endpoint)
client = run.wrap_openai(openai.OpenAI())
client.chat.completions.create(model="gpt-…", messages=[…])

# Anthropic
client = run.wrap_anthropic(anthropic.Anthropic())
client.messages.create(model="claude-…", max_tokens=1024, messages=[…])

# Anything else: record usage yourself
run.record_model_call("my-model", input_tokens=1200, output_tokens=300)

Gemini prices are built in. For other models, add prices under Settings so spend can be estimated.

Sub-agents

child = run.child() creates a run that shares the parent task's budget.

If the service is unreachable

By default the SDK fails open: your agent keeps working, events are kept in memory and sent when the service is back. Use Client(fail_mode="closed") to stop the agent instead when supervision isn't available.

What gets sent

Token counts, model names, test IDs with pass or fail, code revision IDs, and keyed fingerprints of tool arguments and errors. Prompts, replies and code are never sent. See Privacy.

Help improve detection

Open a run in your dashboard and rate each flag as Useful, Too early or False alarm. If a run looked stuck but Supra missed it, use Report a missed loop on that run. Feedback does not pause, continue or stop the agent. Workspace members can update a flag's verdict.

Found something that does not match this guide? Report it on GitHub or use the contact link below. Include the run ID and the step that blocked setup. Keep API keys, prompts and private code out of public issues.

{% endblock %}