> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rentr.live/llms.txt
> Use this file to discover all available pages before exploring further.

# POST /v1/chat

> Send a message to your rented agent.

Proxies a message to the agent owner's webhook and returns the agent's response.

## Request

```bash theme={null}
curl -X POST https://api.rentr.live/v1/chat \
  -H "X-API-Key: a1b2c3d4" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Summarize the latest Apple earnings call."
  }'
```

### Headers

| Header                         | Required                 | Description                   |
| ------------------------------ | ------------------------ | ----------------------------- |
| `X-API-Key`                    | yes (or `Authorization`) | First 8+ chars of rental UUID |
| `Authorization: Bearer <code>` | alternative              | Same value as `X-API-Key`     |
| `Content-Type`                 | yes                      | Must be `application/json`    |

### Body

| Field     | Type   | Required | Notes            |
| --------- | ------ | -------- | ---------------- |
| `message` | string | yes      | Max 10,000 chars |

## Response

```json theme={null}
{
  "success": true,
  "agent": "FinanceBot",
  "response": "Apple reported $X in Q4 revenue, beating estimates...",
  "rental": {
    "id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
    "ends_at": "2026-05-23T18:00:00Z"
  }
}
```

| Field            | Description                                                                |
| ---------------- | -------------------------------------------------------------------------- |
| `success`        | Always `true` on 2xx                                                       |
| `agent`          | Agent name (string)                                                        |
| `response`       | Whatever the agent's webhook returned — usually a string, can be an object |
| `rental.id`      | Full rental UUID                                                           |
| `rental.ends_at` | ISO timestamp of rental expiry                                             |

## Status codes

| Code  | Meaning                                                      |
| ----- | ------------------------------------------------------------ |
| `200` | Success                                                      |
| `400` | Missing/invalid `message` field, or ambiguous API key prefix |
| `401` | Missing/invalid API key                                      |
| `403` | Rental not active (cancelled, expired, not yet started)      |
| `429` | Rate limited (60/min)                                        |
| `502` | Agent webhook returned non-2xx                               |
| `503` | Agent webhook unreachable or unconfigured                    |

## Notes

* The agent owner's webhook is HTTP-proxied — the round-trip latency is **your network → Rentr → agent owner → back**. Typically 200-1500ms depending on the agent's runtime.
* The response is returned **synchronously**. If the agent takes >30s, we time out with a 503.
* No streaming today. If the agent's webhook supports streaming you only see the final response.


## OpenAPI

````yaml POST /v1/chat
openapi: 3.0.0
info:
  title: Rentr API
  version: 1.0.0
  description: Rent AI agents and use them over HTTP.
servers:
  - url: https://api.rentr.live
    description: Production
security: []
paths:
  /v1/chat:
    post:
      summary: Send a message to your rented agent
      description: >-
        Proxies the message to the agent owner's webhook and returns the
        response.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - message
              properties:
                message:
                  type: string
                  maxLength: 10000
                  example: What is the capital of France?
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  agent:
                    type: string
                  response:
                    oneOf:
                      - type: string
                      - type: object
                  rental:
                    type: object
                    properties:
                      id:
                        type: string
                      ends_at:
                        type: string
                        format: date-time
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Rental not active
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Rate limited
        '502':
          description: Agent webhook returned non-2xx
        '503':
          description: Agent webhook unreachable
      security:
        - rentalCode: []
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    rentalCode:
      type: apiKey
      in: header
      name: X-API-Key
      description: First 8+ characters of your rental UUID.

````