API reference

Market API

Manage seller availability and the upstream provider connections that supply marketplace capacity.

Base path

/api/marketplace

Authentication

Bearer dashboard token or personal access token

Response envelope

Successful requests return a consistent envelope. The endpoint examples below show only the data field.

Response
{
  "success": true,
  "message": "",
  "data": { ... }
}
GET/status

Get market status

Returns the current seller lifecycle state and counts for enabled connections and offers.

Response data
{
  "status": "active",
  "active_connections": 2,
  "active_offers": 6,
  "updated_at": 1786345200
}
PATCH/status

Update market status

Set the seller lifecycle state to active or paused.

Pausing disables every active offer and removes enabled connections from routing. Connections remain saved and return to routing when the market is active.

Request body
{
  "status": "paused"
}
Response data
{
  "seller_id": 12,
  "status": "paused",
  "created_at": 1786345000,
  "updated_at": 1786345200
}
GET/providers

List available providers

Returns the provider types the authenticated user may connect. Admin-only provider types are omitted for standard users.

Response data
[
  {
    "id": "openai",
    "name": "OpenAI",
    "base_url_required": false,
    "admin_only": false
  },
  {
    "id": "anthropic",
    "name": "Anthropic",
    "base_url_required": false,
    "admin_only": false
  },
  {
    "id": "gemini",
    "name": "Google Gemini",
    "base_url_required": false,
    "admin_only": false
  }
]
GET/summary

Get seller summary

Returns connections, offers, capacity, and settled provider earnings for the authenticated seller.

Response data
{
  "connections": [ ... ],
  "offers": [ ... ],
  "metrics": {
    "active_connections": 2,
    "active_offers": 6,
    "reserved_capacity_micros": 12500000,
    "used_capacity_micros": 87000000,
    "this_month_earnings_micros": 6240000,
    "lifetime_earnings_micros": 18425000
  }
}
GET/pricing?models=claude-sonnet-4-5&models=gpt-4o

Get reference pricing

Returns configured input and output prices for the requested model IDs. Pass the models query parameter once for each model.

Response data
{
  "pricing": {
    "claude-sonnet-4-5": { "input": 3, "output": 15 },
    "gpt-4o": { "input": 1.25, "output": 10 }
  }
}
GET/connections

List connections

Returns every provider connection owned by the authenticated user. Credentials are never included.

Response data
[
  {
    "id": 18,
    "channel_id": 42,
    "provider": "anthropic",
    "name": "Production Anthropic",
    "models": "claude-sonnet-4-5,claude-opus-4-1",
    "base_url": null,
    "enabled": true,
    "validation_status": "validated",
    "monthly_limit_micros": 100000000,
    "daily_limit_micros": 5000000
  }
]
GET/connections/:id

Get a connection

Returns one owned provider connection by its marketplace connection ID.

Response data
{
  "id": 18,
  "channel_id": 42,
  "provider": "anthropic",
  "name": "Production Anthropic",
  "models": "claude-sonnet-4-5,claude-opus-4-1",
  "base_url": null,
  "enabled": true,
  "validation_status": "validated",
  "monthly_limit_micros": 100000000,
  "daily_limit_micros": 5000000
}
POST/connections

Create a connection

Creates an owned provider channel and validates the connection configuration.

OpenAI-compatible connections additionally require base_url and are limited to administrator accounts.

Request body
{
  "name": "Production Anthropic",
  "provider": "anthropic",
  "credential": "your-provider-api-key",
  "models": "claude-sonnet-4-5,claude-opus-4-1"
}
Response data
{
  "id": 18,
  "channel_id": 42,
  "provider": "anthropic",
  "name": "Production Anthropic",
  "models": "claude-sonnet-4-5,claude-opus-4-1",
  "base_url": null,
  "enabled": true,
  "validation_status": "validated",
  "monthly_limit_micros": 100000000,
  "daily_limit_micros": 5000000
}
PATCH/connections/:id

Update a connection

Updates only the provided fields. Supported fields are name, models, credential, base_url, enabled, monthly_limit_micros, and daily_limit_micros.

Disabling a connection also disables its active offers. A new credential is accepted but is never returned.

Request body
{
  "enabled": false,
  "monthly_limit_micros": 100000000,
  "daily_limit_micros": 5000000
}
Response data
{
  "id": 18,
  "channel_id": 42,
  "provider": "anthropic",
  "name": "Production Anthropic",
  "models": "claude-sonnet-4-5,claude-opus-4-1",
  "base_url": null,
  "enabled": true,
  "validation_status": "validated",
  "monthly_limit_micros": 100000000,
  "daily_limit_micros": 5000000
}
DELETE/connections/:id

Delete a connection

Deletes the connection, its marketplace offers, and the owned upstream channel.

Response data
null
POST/offers

Create an offer

Offers one model from an enabled seller connection at a percentage of the configured retail price.

capacity_micros set to 0 means unlimited capacity. The model must be enabled on the referenced channel, and the seller must be active.

Request body
{
  "channel_id": 42,
  "model": "claude-sonnet-4-5",
  "retail_micros": 3000000,
  "retail_percent": 72,
  "capacity_micros": 100000000
}
Response data
{
  "id": 91,
  "channel_id": 42,
  "seller_id": 12,
  "model": "claude-sonnet-4-5",
  "retail_micros": 3000000,
  "retail_percent": 72,
  "price_micros": 2160000,
  "capacity_micros": 100000000,
  "reserved_micros": 0,
  "status": 1
}
PATCH/offers/:id

Update an offer

Updates the offer retail percentage, capacity, or both.

A finite capacity cannot be reduced below the amount currently reserved.

Request body
{
  "retail_percent": 68,
  "capacity_micros": 150000000
}
Response data
{
  "id": 91,
  "channel_id": 42,
  "seller_id": 12,
  "model": "claude-sonnet-4-5",
  "retail_micros": 3000000,
  "retail_percent": 68,
  "price_micros": 2040000,
  "capacity_micros": 100000000,
  "reserved_micros": 0,
  "status": 1
}
PATCH/offers/:id/status

Set offer status

Enables or disables an owned marketplace offer.

An offer can only be enabled while both the seller lifecycle and its connection are active.

Request body
{
  "enabled": false
}
Response data
{
  "id": 91,
  "channel_id": 42,
  "seller_id": 12,
  "model": "claude-sonnet-4-5",
  "retail_micros": 3000000,
  "retail_percent": 72,
  "price_micros": 2160000,
  "capacity_micros": 100000000,
  "reserved_micros": 0,
  "status": 2
}
DELETE/offers/:id

Delete an offer

Permanently deletes an offer owned by the authenticated seller.

Response data
null
GET/income

List provider earnings

Returns settled provider ledger entries in reverse chronological order with current-month and lifetime earnings in micros. Pending reservations are excluded.

Response data
{
  "entries": [ ... ],
  "total_micros": 18425000,
  "this_month_micros": 6240000
}
GET/usage

Get seller usage

Aggregates request and token usage by model and seller channel.

Response data
{
  "usage": [
    {
      "model_name": "claude-sonnet-4-5",
      "request_count": 84,
      "prompt_tokens": 126400,
      "completion_tokens": 41800,
      "total_tokens": 168200,
      "channel_id": 42
    }
  ]
}