---
title: "Execute a tool with an optional approved quote"
method: POST
path: "/credits/tools/execute"
tags: ["Tool discovery"]
---

# Execute a tool with an optional approved quote

`POST /credits/tools/execute`

## Request

- Base URL: `https://api.paywithlocus.com/api`
- URL: `https://api.paywithlocus.com/api/credits/tools/execute`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer
  - HTTP bearer

Uses the same approval, spending limits, idempotency and billing result as MCP execute. max_credits caps the charge (409 charge_ceiling_exceeded, nothing charged). When a spending policy returns an approval_token and idempotency_key, send both with the identical slug, customer and args. HTTP 200 means the execution envelope was delivered; inspect result.isError and its billing metadata before treating the call as successful. Sandbox credentials are not supported.

## Headers

- `X-Locus-End-User` string

## Request body

- object
  - `slug` string, required
  - `args` object
  - `approval_token` string
  - `max_credits` union: Most credits this call may charge.
    - string
    - number
  - `idempotency_key` string, required
  - `loop_id` string
  - `attribution` object

## Response `200`

MCP-compatible tool result, including success or failure and charge metadata

- object
  - `success` unknown, required
  - `result` object, required
    - `isError` boolean
    - `content` object[]
    - `structuredContent` object
    - `_meta` object

## Other responses

- `400`: Invalid execution request
- `401`: Invalid credentials
- `403`: Execution is not permitted

---

[API](https://skmtc.dev/paywithlocus/apis/locus-pro-api.md) - [All operations](https://skmtc.dev/paywithlocus/apis/locus-pro-api/llms.txt) - [OpenAPI document](https://skmtc.dev/paywithlocus/apis/locus-pro-api/revisions/aab8fa5d6cef?raw)
