# OpenAgents Agent Cloud — agent guide

OpenAgents sells inference and verified coding outcomes **per call**. This page
tells an agent how to call the inference gateway and how machine payment works.

## Call Khala (OpenAI-compatible)

Khala speaks the OpenAI Chat Completions contract. Change only the base URL and
the model:

```bash
curl https://openagents.com/api/v1/chat/completions \
  -H "authorization: Bearer <your-openagents-agent-key>" \
  -H "content-type: application/json" \
  -d '{
    "model": "openagents/khala",
    "messages": [{"role": "user", "content": "Hello"}]
  }'
```

Models: `openagents/khala` only. It is the single public Khala surface for
general chat, coding, and OpenAgents-specific capabilities.
Catalog:
https://openagents.com/api/v1/models

Every response is standard OpenAI shape plus a non-breaking `openagents`
disclosure block (which concrete worker served the request, the supply lane, and
a dereferenceable receipt ref when metered).

## Pay per call (no signup) — Machine Payments / x402

For agents that would rather pay per request than hold an account key, the
machine-payment endpoint is:

    https://openagents.com/api/mpp/v1/chat/completions

The flow follows the Machine Payments Protocol (MPP) / x402:

1. Your request with **no payment credential** returns
   `402 Payment Required` with one or more `WWW-Authenticate: Payment ...`
   challenges describing the price and how to pay.
2. Your payment tool (e.g. `mppx`) pays and **retries** the request with an
   `Authorization: Payment ...` credential.
3. The server verifies the credential, runs the same Khala completion, and
   returns it with the usage receipt.

Accepted rails: **Lightning** (BOLT11), **USDC** (x402 on Base; MPP on Solana /
Tempo), and **card** via shared payment tokens. Microtransactions to 0.01 USDC.
Settled machine payments mint inference credits that flow through the same
metering + receipt path as keyed calls; the **contributor payout rail stays
Bitcoin/Spark**.

## More

- https://openagents.com/llms.txt — directory summary
- https://openagents.com/AGENTS.md — full agent onboarding
- https://openagents.com/docs/product-promises — pricing + product promises
