01File format
The first two lines identify the config format and version.
Your agent builds the tool.
Recurse gives it a place to run.
Bring your coding agent. Give it a task. It writes Python, combines eligible APIs, and runs the work privately through your Recurse account.
Looking for hosted Agents? Jump to the advanced guideyour computer
Exa
Firecrawl
DataForSEOEligible APIsSign in with Google, open your wallet, and create an access key for your agent. New accounts start with $1 credit; add funds when needed.
Copy the setup message into your coding agent. It loads the Recurse skill, imports the key into your operating-system keychain, and connects the Recurse Tools MCP bridge.
The agent needs local file creation and scoped HTTP upload. Setup and API discovery do not run a paid task.
Set up your agentRecurse skill loaded
Key saved in OS keychain
API discovery connected
Tell your agent what you want to accomplish, or choose an example. It searches the live API catalog and inspects the endpoints it needs before writing the tool.
Each endpoint has its own inputs, response schema, execution eligibility and price ceiling. Your agent works from those contracts, then chooses how to combine the results.
Eligible calls use Recurse’s provider access and your wallet. Operations requiring customer-owned connections remain unavailable where indicated. Actions that change something need your explicit authorization.
Explore example tasksapis_search
ExaInspect endpointapis_get → exa.web.searchYour agent writes a small project: Python for the work, tools.yaml for function inputs, outputs and allowed API IDs, plus a package definition and locked dependencies.
Python can call the declared APIs, transform their data and return JSON. A compute-only tool can run without calling any API.
Your external agent supplies the reasoning and revisions. A private Tools run executes the function directly, with no added prompt, hosted model or agent loop.
Read the Tools manifestfrom recurse_apis import call
def research(query: str) -> dict:
result = call(
"exa.web.search",
{"query": query},
)
return {"evidence": result}Before chargeable work, agree a total allowance with your agent. The cap covers source preparation, API requests and execution. Your wallet balance alone is not permission to spend it.
The SDK packages and uploads the source. Recurse prepares the private environment, freezes its API contracts and pricing, then runs the registered function with your inputs.
Preparation is a separately charged phase and can cost money even if it fails. Private execution does not publish your tool in the public catalog.
See the complete run flowrecurse tools run ./company-news
--function research
--inputs inputs.json
--idempotency-key REQUEST_KEY
--max-cost-micro-usd APPROVED_CAPYour Python runs in an isolated sandbox. The recurse_apis helper sends its declared API requests to the trusted service, which handles provider credentials, transport and metering.
The source receives no provider keys and no unrestricted network access. API calls are available inside the registered function during execution, after preparation has completed.
One execution supports up to 20 sequential API requests. An unresolved request must be resolved before another paid request can start.
Check access and execution limitsrecurse_apis.call(...)
Exa
FirecrawlYour agent receives a call receipt and follows it to the result. Open Activity to inspect preparation and execution, including errors, reservations and settled charges.
If a response is lost, your agent recovers the original request with the same source, function, inputs, request key and cap. A new request key starts new work. Failed or cancelled Python may still have incurred API costs.
Ask your agent to revise the code or reuse it with new inputs. Reusing the same prepared version avoids its original preparation charge. Results normally remain available for 24 hours; prepared images for seven days.
Cancellation is a request. Follow the receipt to confirm that execution stopped and billing settled. Pending or uncertain provider costs remain reserved until reconciliation.
Replaying an expired result recovers its receipt, not its content. Agree another allowance before starting a new paid execution.
your request identitySettled provider cost passes through at 1×. Preparation and execution compute are charged at 4× their cost basis.
Current API rates and ceilings come from the catalog. Your approved cap is an allowance; receipts record what was actually charged.
Tools pricing and limitsLarge media and asynchronous jobs must fit these limits. Follow the original job’s receipt before submitting new work.
Your agent can take it from there.
Some tasks benefit from an agent that explores alternatives, measures them and tries again. With Recurse Agents, your coding agent authors an agent.yaml project with a prompt, Python tools and verifiers. Recurse hosts the model and the tool loop for each run.
The hosted agent uses tool results and verifier feedback to revise candidates within a run. Your coding agent improves the project between runs. Use recurse run to test it, then deploy a reusable agent through MCP. Existing deployments continue to work.
The SDK walkthrough, manifest, runtime secrets and pricing below describe this separate workflow. Private Tools use tools.yaml, your external agent’s model and the limits explained above; the Tools API helper is not automatically supplied to hosted Agents.
This retained example shows the separate Recurse Agents deployment workflow. Private Tools runs do not require an agent prompt or published app.
The coding agent reads the Recurse skill, writes instructions and Python tools, and tests the app on sample inputs.
It uses the CLI to package and deploy the project. Recurse provides the runtime for the agent and its tools.
The agent connects the deployment to your MCP client. You can then ask the client to use your app.
Your coding agent handles the setup. Here’s a look at the config file that brings the project together.
apiVersion: recurse.run/v1alpha1
kind: Agent
agent:
prompt: prompt.md
inputs:
type: object
properties:
query: {type: string}
speedup:
type: number
default: 2
task:
type: string
default: Optimize {{ input.query }}.
outputs:
type: object
required: [result]
properties:
result: {type: string}
tools:
source: tools.py
built_in: true
register:
search: ~
verify: ~The first two lines identify the config format and version.
The prompt file contains the agent’s instructions.
Describe the information the agent needs, with defaults for optional values.
Set the result format. Recurse checks that successful runs return values in that format.
List the Python functions the agent can call, alongside Recurse’s built-in tools.
Legacy Agents setup: deploy your own agent with the CLI. For private Tools, use the Setup page.
pip install recurse-sdkrecurse deploy . --as mcprecurse run . --inputs sample.jsonRun from your agent project. Read the docs
Find the smallest image file that still meets your quality target.
Download agent projectRead https://recurse.run/agents/SKILL.md. Build an image optimizer with encoding and quality tools. Test it, deploy it as an MCP, and help me connect it to my coding agent.
Save your API key. Use it in your app.
Paste and confirm it in the hidden prompt.
recurse secret set githubDeploy with the secret attached.
recurse deploy . --as mcp \
--secret GITHUB_TOKEN=githubRecurse loads the key when your tools run.
Read the secrets guideWrite the instructions and tools, test them on a sample task, and deploy the app as an MCP.
Tell your coding agent what you want to build. It writes the instructions, Python tools and project files.
image-optimizer/
├── agent.yaml
├── prompt.md
├── tools.py
├── pyproject.toml
└── uv.lock
Run the agent on a sample task and check the result. For the image optimizer, check that the smaller image still looks good.
recurse run . --inputs sample.json
Recurse hosts the agent and makes it available through MCP. Choose more CPU or memory if your app needs it.
recurse deploy ./image-optimizer \
--as mcp \
--cpu 2 \
--memory-mib 2048
Legacy Agents pricing. Private Tools use 1× provider cost and 4× compute; see the Tools setup guide.
0% token markup
We don’t charge any markup on input or output tokens.
Supported models: GPT-5.6 (Luna, Terra, Sol) and GPT-6 (Astra, Luna, Sol).
$0.013 / minute
Approximate compute rate at default resources for your agent and its tools. Only active requests are billed.
Non-preemptible direct runs have 3× CPU and memory charges. Model calls and other charges stay at their normal rates. Costs and limits