# API reference

Every public operation of the Abazi API, one page each, generated from the OpenAPI contract, with the rules that apply to all of them.

<ShortProductTruth>Everything an agent, an owner's app or a merchant does in Abazi is one HTTP call to the Abazi API. These pages are generated from the same OpenAPI contract the product is built against, on every build.</ShortProductTruth>

## Base URL [#base-url]

Every path in this reference is relative to the base URL `https://api.52-28-238-205.sslip.io`. [Environments](/docs/platform/environments) lists the MCP endpoint and the networks the current environment settles on. Abazi refuses to start against a network that is not configured for its environment.

```bash title="A first call"
curl "https://api.52-28-238-205.sslip.io/v1/spending" -H "Authorization: Bearer YOUR_AGENT_KEY"
```

Replace `YOUR_AGENT_KEY` with an agent credential: create one in the [Console](https://app.52-28-238-205.sslip.io) under **Agents > New agent** (shown once). See [Credentials](/docs/api/credentials).

## Authentication [#authentication]

Each operation states the credentials it accepts.

| Credential | Who holds it | How it is sent |
| --- | --- | --- |
| Agent credential | An agent | `Authorization: Bearer agk_test_...` |
| API key | An organization's or a merchant's backend | `Authorization: Bearer sk_test_...` |
| Console session | A person in the web apps | A session cookie |

An agent credential identifies an agent and carries no spending power of its own: the owner's mandate decides what it may buy. Sensitive Console actions also need a recent passkey step-up. See [Authentication](/docs/api/credentials).

## Rules for every call [#rules-for-every-call]

<Cards>
  <Card title="Authentication" href="/docs/api/credentials" description="Agent credentials, API keys and console sessions, and which call accepts which." />
  <Card title="Idempotency" href="/docs/api/idempotency" description="Retry a purchase safely without paying twice." />
  <Card title="Errors and reason codes" href="/docs/api/errors-and-reason-codes" description="One error shape for every failure, and the codes a policy decision carries." />
  <Card title="Amounts and currencies" href="/docs/api/amounts-and-currencies" description="Integer base units carried as strings, assets and networks." />
  <Card title="Pagination and filtering" href="/docs/api/pagination" description="Cursors, page sizes and filters on list operations." />
  <Card title="Versioning" href="/docs/api/versioning" description="How the contract changes and what stays compatible." />
</Cards>

## Resources [#resources]

Operations are grouped by resource in the sidebar, each with its HTTP method. A few to start with:

- <ApiOperation id="createPaymentIntent" />, the purchase an agent makes, and <ApiOperation id="getPaymentIntent" /> to follow it.
- <ApiOperation id="listApprovals" /> and <ApiOperation id="approveApproval" /> for the person in the loop.
- <ApiOperation id="getReceipt" /> and the public <ApiOperation id="getPublicReceipt" /> to prove what happened.

## Clients [#clients]

The reference is generated from the OpenAPI contract, so any OpenAPI tool can build a client from it.

<Cards>
  <Card title="Plain HTTP" href="/docs/agents/http-api" description="Call the Abazi API with curl or any HTTP client." />
  <Card title="TypeScript" href="/docs/agents/typescript" description="A client typed from the OpenAPI contract." />
</Cards>

Agents usually call the same actions through [MCP tools](/docs/mcp), and integrations receive [webhooks and events](/docs/webhooks) instead of polling.

