Docs

API Reference

Everything you need to integrate Zentri APIs into your agent — one key, one endpoint, every tool.

Quick Start

Get from zero to your first API call in under 3 minutes.

1

Create an account & get your API key

Sign up at zentri.us/signup then go to Dashboard → Account to generate your key. It starts with sk-am-.

2

Browse the marketplace & pick an API

Visit the Marketplace to find available APIs. Each listing shows the apiId, credit cost, and parameters.

3

Make your first call

curl
curl -X POST https://zentri.us/api/call/perplexity-search \
  -H "Authorization: Bearer sk-am-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query": "latest AI news 2025"}'

Authentication

All requests to the proxy must include your API key in the Authorization header using the Bearer scheme.

http
Authorization: Bearer sk-am-YOUR_KEY
Never expose your key in client-side code. Store it in an environment variable: AGENTMARKET_API_KEY

You can generate and revoke keys anytime from Dashboard → Account. Keys are hashed — we never store the raw value, so save it when you create it.

Making a Call

Every API on the marketplace is called through a single proxy endpoint. Your agent never talks to the upstream provider directly — Zentri handles auth, billing, and rate limiting.

POST https://zentri.us/api/call/{apiId}

The apiId is the unique slug for each API shown in the marketplace (e.g. perplexity-search). The request body is forwarded as-is to the upstream provider.

Example — Perplexity Web Search

Search the live web and get cited, up-to-date answers. Costs 5 credits per call.

curl
curl -X POST https://zentri.us/api/call/perplexity-search \
  -H "Authorization: Bearer sk-am-YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "latest AI models released in 2025",
    "search_type": "pro"
  }'

Response Format

Every successful response is the original provider JSON with one extra field injected at the top level: _marketplace.

json
{
  // ... everything the upstream provider returned ...
  "results": [ { "title": "...", "url": "...", "snippet": "..." } ],

  // injected by Zentri
  "_marketplace": {
    "credits_used": 5,
    "credits_remaining": 995,
    "latency_ms": 312,
    "api_id": "perplexity-search"
  }
}

The response also sets three HTTP headers you can read without parsing JSON:

HeaderValue
X-Credits-UsedCredits deducted for this call
X-Credits-RemainingYour balance after this call
X-Latency-MsTime taken to reach the upstream provider

Credits & Pricing

Every API on the marketplace has a base credit cost per call. Some APIs also support variable pricing — credits depend on a parameter in your request body (e.g. video duration, token count).

1 credit = $0.01. Credits are deducted after a successful call. If the upstream provider returns an error, credits are not deducted.

If you don't have enough credits, the proxy returns a 402 error before forwarding to the provider — you're never charged for a failed call.

Variable pricing example

An API like Sora 2 (video generation) charges different credits based on the duration parameter:

json
// 5-second clip → 60 credits
{ "prompt": "A drone flying over the ocean", "duration": 5 }

// 10-second clip → 95 credits
{ "prompt": "A drone flying over the ocean", "duration": 10 }

The exact pricing tiers for each API are shown on its marketplace listing.

Buy credits from Dashboard → Billing. Credits never expire.

Rate Limits

Each API enforces two independent rate limits measured in requests per minute (RPM):

LimitScope
rpmTotal requests/min across all users for this API
user_rpmYour personal requests/min for this API

When you hit a rate limit, the response is a 429 with a Retry-After header telling you how many seconds to wait:

json
// HTTP 429 Too Many Requests
// Retry-After: 12

{
  "error": "Rate limit exceeded (per-user RPM)",
  "retry_after_seconds": 12
}

Error Codes

All errors follow the same shape: an HTTP status code and a JSON body with an error field.

CodeNameMeaning
400Bad RequestRequest body is not valid JSON.
401UnauthorizedMissing or invalid Authorization header / API key.
402Payment RequiredYour credit balance is too low for this call.
404Not FoundThe apiId in the URL doesn't match any published API.
429Too Many RequestsYou hit the global or per-user rate limit. Check Retry-After.
502Bad GatewayThe upstream provider was unreachable.
503Service UnavailableThe API is currently paused by its publisher.

Insufficient credits (402)

The 402 response includes extra fields to help your agent recover:

json
{
  "error": "Insufficient credits",
  "credits_required": 5,
  "credits_available": 2,
  "top_up_url": "https://zentri.us/pricing"
}

.skill.md for Claude Code

Zentri APIs are designed to be used directly by AI agents via .skill.md files. Drop one into your Claude Code project and the agent discovers and calls the tool automatically — no extra integration needed.

Here is the .skill.md for the Perplexity Search API:

markdown
---
skill: perplexity-search
description: Search the live web and return cited, up-to-date results. Use this whenever the user asks about recent events, current prices, news, or anything that requires real-time information.
---

# perplexity-search

## Endpoint
POST https://zentri.us/api/call/perplexity-search

## Authentication
Authorization: Bearer <AGENTMARKET_API_KEY>

## Parameters
| Name        | Type   | Required | Description                              |
|-------------|--------|----------|------------------------------------------|
| query       | string | yes      | The search query                         |
| search_type | string | no       | "default" or "pro" (default: "default")  |

## Cost
5 credits per call

## Example
```json
{
  "query": "latest GPT-5 benchmarks",
  "search_type": "pro"
}
```

## Response
Returns the provider response with a _marketplace block appended:
```json
{
  "results": [...],
  "_marketplace": {
    "credits_used": 5,
    "credits_remaining": 995,
    "latency_ms": 312,
    "api_id": "perplexity-search"
  }
}
```
You can download the .skill.md file for any API directly from its marketplace listing page.

Using with Claude Code

bash
# 1. Set your key
export AGENTMARKET_API_KEY=sk-am-YOUR_KEY

# 2. Drop the skill file in your project root
cp perplexity-search.skill.md ./

# 3. Run Claude Code — it picks up the skill automatically
claude

Claude Code reads .skill.md files from the project root. Once loaded, the agent can call the API on its own when it determines a web search is needed.

Ready to build?

Browse the marketplace and start calling APIs in minutes.