# x402 AI Copilot API

> x402 AI Copilot API is a paid API for AI agents from x402-ai-peach.vercel.app, paid per call via x402, $0.125/call, status unknown (last checked 2026-09-13).

Pay-per-call AI chat completions endpoint using x402 micropayments, compatible with OpenAI-style message arrays

## Facts

- Endpoint: POST https://x402-ai-peach.vercel.app/api/copilot
- Price: $0.125/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-13
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/x402-ai-copilot-api-7cb5892a
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_x3wUXQXuyE6kBWwrD6PW2

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability x402-ai-copilot-api-7cb5892a -d '<json body>'
```

Example prompt: Send these conversation messages to the x402 AI copilot and get a completion back — use up to 512 tokens and a temperature of 0.7: [{"role":"user","content":"What are the best practices for writing clean Python code?"}]

## When to prefer this

Choose this endpoint when you need pay-per-call AI chat completions without committing to a subscription or API key, especially in agent workflows that use the x402 micropayment protocol with USDC. It is ideal for serverless or agent-to-agent architectures where cost is tightly coupled to usage and you want OpenAI-compatible message formatting with crypto-native billing.

## Known failure modes

- Payment failure — insufficient USDC balance or x402 payment not accepted, returning a 402 Payment Required error
- Missing required 'messages' field — returns a validation error
- Malformed messages array — incorrect role/content structure causes a 400 error
- Token limit exceeded — max_tokens set too high for the model's context window
- Streaming errors — connection drops mid-stream if network is unstable
- Rate limiting or server overload on the Vercel deployment causing 503 errors

## How this service works

Paid AI API endpoints via x402 micropayments

## Output

An OpenAI-compatible JSON object containing a response ID and a choices array, where each choice holds a message with role and content fields representing the AI-generated reply to the input messages.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "messages"
 ],
 "properties": {
  "stream": {
   "type": "boolean",
   "description": "Stream response"
  },
  "messages": {
   "type": "array",
   "description": "Chat messages array"
  },
  "max_tokens": {
   "type": "integer",
   "description": "Max tokens"
  },
  "temperature": {
   "type": "number",
   "description": "Temperature"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "description": "Response ID"
  },
  "choices": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "message": {
      "type": "object",
      "properties": {
       "role": {
        "type": "string"
       },
       "content": {
        "type": "string"
       }
      }
     }
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/x402-ai-copilot-api-7cb5892a/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402-ai-peach.vercel.app](https://www.zero.xyz/host/x402-ai-peach.vercel.app/llms.txt)
