Request & Response Format

Request & Response Format

Learn the standard structure for sending requests and parsing API responses.

Request Format

Every API endpoint expects a JSON payload. Below is a base structure. Note: The endpoint URLs and exact required fields will change depending on the specific API you are calling.

JSON Payload Example
{
  "message":    "string  — required — the primary input or prompt",
  "provider":   "string  — optional — defaults to account setting"
}

Response Contract

Every API response — success or error — follows a predictable JSON structure.

Success Response 2xx

JSON
{
  "success": true,
  "request_id": "req_w8x2b1l9zp",
  "data": {
    "key": "value"
  },
  "meta": {
    "version": "v1",
    "timestamp": "2026-04-12T18:00:00.000000Z"
  }
}

Error Response 4xx / 5xx

JSON
{
  "success": false,
  "request_id": "req_w8x2b1l9zp",
  "error": {
    "code": "INVALID_API_KEY",
    "message": "The provided API key is invalid or has been revoked.",
    "details": []
  },
  "meta": {
    "version": "v1",
    "timestamp": "2026-04-12T18:00:00.000000Z"
  }
}
Always check success first
Parse success before reading data. On errors, error.code and error.message are present — while data will be absent, meta and request_id will remain.

Ready to build?

Create your free account and make your first API call in minutes.