Skip to main content
GET
/
requests
List requests
curl --request GET \
  --url https://api.lavapayments.com/v1/requests \
  --header 'Authorization: Bearer <token>'
{
  "data": [
    {
      "request_id": "req_01K7QJT2YQKB9E6SB3J4VRDJEV",
      "status": "pending",
      "connection_id": "con_01K7QJT2YQ2E3FYAXD1VEJM5ZJ",
      "product_id": "prd_01K7QJT2YQPDBCFD7FR9MWF077",
      "provider": "openai",
      "model": "gpt-4",
      "endpoint": "POST https://api.openai.com/v1/chat/completions",
      "provider_key_type": "managed",
      "response_id": "chatcmpl-abc123def456ghi789",
      "model_usage": {
        "input_tokens": 845,
        "output_tokens": 412,
        "total_tokens": 1257,
        "input_characters": 0,
        "output_characters": 0,
        "total_characters": 0,
        "input_seconds": 0,
        "output_seconds": 0,
        "total_seconds": 0,
        "input_cost": "0.0169000000",
        "output_cost": "0.0412000000",
        "total_cost": "0.0581000000",
        "payer": "wallet"
      },
      "fee": {
        "amount": "0.0058100000",
        "rate_type": "percentage",
        "token_basis": "input+output",
        "breakdown": [
          {
            "tier": {
              "start": 0,
              "rate": "0.0000000000",
              "type": "tokens_1m"
            },
            "tokens": 1000000,
            "characters": 0,
            "seconds": 0,
            "cost": "0.0000000000"
          }
        ]
      },
      "service_charge": {
        "amount": "0.0058100000",
        "payer": "wallet"
      },
      "total_request_cost": "0.0639100000",
      "total_wallet_cost": "0.0639100000",
      "total_merchant_cost": "0.0000000000",
      "metadata": {
        "key": "user_id",
        "value": "123456"
      },
      "timestamp": "2023-05-15T14:22:31Z",
      "created_at": "2023-05-15T14:22:31Z"
    }
  ],
  "has_more": true,
  "next_cursor": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer token authentication used for standard API calls. Format: 'Bearer YOUR_API_KEY'

Query Parameters

cursor
string

Cursor for pagination

limit
integer
default:10

Maximum number of results to return (1-100)

Required range: 1 <= x <= 100
connection_id
string

Filter requests by connection ID

product_id
string

Filter requests by product ID

metadata_filters
string

Filter requests by metadata key-value pairs. Must be a JSON array of [key, value] pairs, where both key and value are strings. Keys must contain only ASCII letters, numbers, and underscores (no spaces or special characters). Example: [['user_id', '123'], ['session_id', 'abc']]

Response

List of requests

data
object[]
required
has_more
boolean
required

Whether there are more results available

next_cursor
string

Cursor to use for the next page of results, if has_more is true