Skip to content
Back to skills

Apicity

ASecurity

Call any supported provider API (OpenAI, Anthropic, xAI, fal, KIE, ElevenLabs, S3, Telegram, Polymarket and 24 more) through the apicity CLI. Use for ANY task that needs a provider API: generation, upload, lookup, posting, trading data, or checking what an endpoint expects.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 20, 2026
ai-agentsrustgoshellbashsqlexpressapidatabase

Works with

  • terminal
  • cli
  • api

Security analysis

A100/100

Scanned November 21, 2026

npx -y skills add justintanner/apicity --skill apicity --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Apicity?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Apicity
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/justintanner-apicity/badge)](https://www.skillsdirectory.com/skills/justintanner-apicity)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: apicity
description: |
  Call any supported provider API (OpenAI, Anthropic, xAI, fal, KIE, ElevenLabs,
  S3, Telegram, Polymarket and 24 more) through the apicity CLI. Use for ANY
  task that needs a provider API: generation, upload, lookup, posting, trading
  data, or checking what an endpoint expects.
triggers:
  - apicity
  - /apicity
  - apicity commands
  - apicity describe
  - apicity providers
  - apicity doctor
  - call a provider api
  - generate an image or video
  - text to speech
  - upload a file
  - post to telegram
  - post to x
---

# apicity — one command line for 34 provider APIs

`apicity` calls any endpoint of any supported provider. There is no tool list to
load and no catalog to memorise: three offline commands discover what exists,
and every endpoint is then addressed the same way.

```bash
apicity providers                          # who exists, and what is configured
apicity commands --provider anthropic      # that provider's endpoints
apicity describe anthropic v1.messages     # one endpoint, in full
apicity anthropic v1.messages --data '{"model":"claude-sonnet-4-5","max_tokens":1024,"messages":[{"role":"user","content":"hi"}]}'
```

To pick an image or video model, run `apicity frontier <type>` and call the
dotPath it prints with the model id it prints. `price` is the bundled rate
(`0.04-0.16 USD/s`, `0.08 USD/image`, `dynamic`, or `-`).

The shape never changes: **`apicity <provider> <dotPath> [flags]`**, where
`<dotPath>` mirrors the upstream URL path (`/v1/chat/completions` is
`v1.chat.completions`, `/api/v1/common/download-url` is
`api.v1.common.downloadUrl`).

## Agent Invariants

**MUST follow these rules:**

1. **Never print, request, or read credentials.** Do not `cat` a `.env` file,
   do not echo `$OPENAI_API_KEY` or any other variable's value, do not run
   `op read`, and never put a key in a command line, a log, a commit, or a
   message. `apicity` reads its own credentials from the environment; your job
   is to call the endpoint, not to handle the secret. Naming a variable is
   fine, printing its value never is.
2. **Never mint an OTP or a grant, never ask for the pay-gate secret, and never read or print files in the grant directory.**
   An operator can arm a pay gate on gated endpoints; a gated call then answers
   `paygate` until an operator-minted OTP (or, for `gate: "cli"` endpoints, an
   operator-minted provider grant on disk) covers it. If a call answers
   `paygate`, report what the `hint` says the operator must do and stop. Do not
   read the secret file or grant directory, do not run the minting command, do
   not retry.
3. **Prefer `--json`.** It selects the machine envelope on every command, so
   you parse one predictable document instead of a rendered table. Add
   `--quiet` when you want the data with no envelope around it.
4. **Discover before calling.** `apicity providers`, then
   `apicity commands --provider <provider> --json`, then
   `apicity describe <provider> <dotPath> --json`. All three are offline: they
   read a generated catalog, need no credential, and cost nothing. Never guess
   a dotPath — if `describe` says `not_found`, list the provider's commands.
5. **Treat exit 3 and exit 4 as blocked.** `auth` (3) means the credential is
   missing or rejected; `forbidden` (4) means it is valid but not allowed to
   make this call; `paygate` (4) means the operator's pay gate refused it.
   Report the block, name what the operator must set or mint, and move on. Do
   not retry, do not hunt for another key, do not switch providers to work
   around a credential you were not given.
6. **Paid endpoints bill: say so before spending.** `apicity describe` shows
   `paid: true` for every call that bills (`billing` says how), and on an armed
   host every paid endpoint (`gated: true`, enforced at `gate`: `"sdk"` or
   `"cli"`) needs an OTP.
   State the endpoint and that it bills, then call it without `--otp`. Pass
   `--otp` only with a token the operator gave you after a call answered
   `paygate` with `otp-missing` (see [Paid endpoints](#paid-endpoints)).
7. **Never pass `--token`, `--apiKey`, or any credential-shaped flag.** Some
   endpoints carry a credential inside the URL (`bot{token}`, `json/{apiKey}`).
   The provider substitutes those from the configured environment; they are not
   flags, and the CLI rejects them with a `usage` error. Pass only the
   parameters `describe` lists.
8. **Let the CLI save media.** Binary results and media URLs are written to the
   output directory and reported as a path; never pipe bytes through the shell
   or re-download a URL the CLI already saved.

## Output and exit codes

Every invocation prints **exactly one JSON document**, and success and failure
never share a stream: success goes to stdout, failure to stderr.

A **call** answers the success envelope, and so do `skill install` and the
discovery commands, `providers`, `commands` and `describe`:

```jsonc
// stdout
{ "ok": true, "data": { ... }, "summary": "apicity skill installed" }
```

`summary` appears only where a command has a one-liner. Read the result under
`data` — for discovery, an array of rows or one endpoint object:

```bash
apicity providers --json | jq '.data[] | select(.configured) | .provider'
apicity commands --provider kie --json | jq '.data[] | select(.paid) | .dotPath'
apicity describe kie api.v1.jobs.createTask --json | jq '.data.paid'
```

**Failure is always the error envelope**, on stderr, from every command:

```jsonc
// stderr
{
  "ok": false,
  "error": "no endpoint at openai v1.chat.completion",
  "code": "not_found",
  "hint": "run: apicity commands --provider openai",
}
```

`meta` appears only where the failure carries structure — a provider's HTTP
`status`, the `methods` behind an `ambiguous`.

**The envelope is automatic when you are not a terminal.** A piped or captured
stdout selects the machine form on its own, so an agent gets JSON without
asking. `--json` forces it anyway (do pass it: it is explicit, and it holds at
a terminal too, where discovery would otherwise print a table). `--quiet`
prints the `data` alone — with `--json` it is one compact line.

**`code` is the contract, not the number.** Branch on `code`; the exit status
is for shells, and several codes share one.

| Exit | Code               | When                                                                                                               |
| ---- | ------------------ | ------------------------------------------------------------------------------------------------------------------ |
| 0    | —                  | success                                                                                                            |
| 1    | `usage`            | unknown flag, missing `--<param>`, invalid `--data`, missing `--data-file`, refused combination                    |
| 1    | `skill_unmanaged`  | a skill directory or link apicity did not write occupies the install path                                          |
| 2    | `not_found`        | unknown provider or dotPath, or the upstream answered HTTP 404                                                     |
| 3    | `auth`             | no credential configured, a 1Password read failed, or the upstream answered HTTP 401                               |
| 4    | `forbidden`        | upstream HTTP 403                                                                                                  |
| 4    | `paygate`          | the operator's pay gate refused a missing or bad `--otp` on a paid endpoint, or an `--otp` reached an unarmed host |
| 5    | `rate_limit`       | upstream HTTP 429                                                                                                  |
| 6    | `network`          | fetch failure, DNS failure, timeout                                                                                |
| 7    | `api`              | any other upstream failure, or a local operational failure such as an unwritable output dir                        |
| 7    | `setup_incomplete` | an agent was not detected or a setup step failed                                                                   |
| 8    | `ambiguous`        | the dotPath carries more than one method and `--method` is absent                                                  |

Media never comes back as bytes on stdout. A binary result is written to the
output directory and reported as `{"savedTo": "<path>", "bytes": 12345}`; a JSON
result carrying media URLs is returned with a sibling `<key>_savedTo` beside
each one. A URL that answers with a web page is left as sent, with no sibling.
An upload ticket, an object that also carries `upload_url` or
`uploadUrl`, comes back untouched: nothing exists at its URLs until you PUT the
bytes to its upload URL. So does an `endless` result, whose URLs are web pages.
The directory is `--output-dir`, else
`$APICITY_OUTPUT_DIR`, else `$CLAUDE_PROJECT_DIR`, else the working directory.

## Quick Reference

| Task                                  | Command                                                                                       |
| ------------------------------------- | --------------------------------------------------------------------------------------------- |
| List providers and what is configured | `apicity providers --json`                                                                    |
| List every endpoint                   | `apicity commands --json`                                                                     |
| List one provider's endpoints         | `apicity commands --provider openai --json`                                                   |
| Same, shorthand                       | `apicity openai`                                                                              |
| Describe one endpoint                 | `apicity describe anthropic v1.messages --json`                                               |
| Describe one method of it             | `apicity describe openai v1.chat.completions --method GET --json`                             |
| Describe from the call form           | `apicity openai v1.chat.completions --help`                                                   |
| Call an endpoint                      | `apicity openai v1.embeddings --data '{"model":"text-embedding-3-small","input":"hello"}'`    |
| Call with the body in a file          | `apicity openai v1.embeddings --data-file ./req.json`                                         |
| Call with the body on stdin           | `cat req.json \| apicity openai v1.embeddings --data -`                                       |
| Pass a path or field parameter        | `apicity elevenlabs v1.textToSpeech --voiceId 21m00Tcm4TlvDq8ikWAM --data '{"text":"hello"}'` |
| Choose a method                       | `apicity openai v1.chat.completions --method GET`                                             |
| Save media somewhere                  | `apicity openai v1.audio.speech --data-file ./speech.json --output-dir ./out`                 |
| Call a paid endpoint (it bills)       | `apicity kie api.v1.jobs.createTask --data-file ./job.json`                                   |
| See the raw HTTP exchange             | `apicity anthropic v1.models.list --verbose`                                                  |
| Explain the envelope                  | `apicity help output`                                                                         |
| Explain the exit codes                | `apicity help exit-codes`                                                                     |
| Explain the environment               | `apicity help environment`                                                                    |
| Guidance for agents                   | `apicity help agents`                                                                         |
| Print this skill                      | `apicity skill`                                                                               |
| Install this skill for your agents    | `apicity skill install`                                                                       |
| Print the version                     | `apicity version`                                                                             |

## Decision Tree

1. **Find the provider.** `apicity providers --json` answers every provider,
   its credential variable names, and whether it is configured. Unconfigured
   providers still describe; they just cannot be called.
2. **Find the endpoint.** `apicity commands --provider <provider> --json`. Each
   row carries `method`, `dotPath`, `pathParams`, `requestParams`, `paid`,
   `billing`, `gated`, `gate` and `configured`. Search that list rather than guessing a name.
3. **Describe it.** `apicity describe <provider> <dotPath> --json` adds the
   request JSON Schema, a recorded example payload when one exists, and the
   call shape. Read `pathParams` and `requestParams`: both are passed as
   `--<name>` flags, and everything else belongs in `--data`.
4. **Call it.** `apicity <provider> <dotPath> [--<param> <value>] --data '{…}'`.
   If the dotPath answers more than one method you get `ambiguous` (8) until
   you add `--method`.
5. **Read the result.** `data` holds it on every command above: the
   provider's response on a call, the rows or the endpoint on discovery. Media
   is already on disk — use the `savedTo` path or the `<key>_savedTo` sibling
   rather than fetching the URL again.

If a step fails, the `code` tells you which step to go back to: `not_found`
sends you to step 2, `ambiguous` to `--method`, `usage` to step 3, and `auth`
or `paygate` stops the task with a report.

## Provider Reference

One entry per provider. The invocations are real catalog rows; run
`apicity commands --provider <provider> --json` for the rest, and
`apicity describe` before filling in a payload.

### openai — chat, images, audio, embeddings, files, batches

`v1.chat.completions` answers DELETE, GET and POST, so a call names one.

```bash
apicity openai v1.chat.completions --method POST --data '{"model":"gpt-5","messages":[{"role":"user","content":"Summarise this."}]}'
apicity openai v1.images.generations --data '{"model":"gpt-image-1","prompt":"a red bicycle"}'
apicity openai v1.audio.speech --data '{"model":"gpt-4o-mini-tts","voice":"alloy","input":"Good morning."}'
```

### anthropic — messages, batches, files, models, skills

```bash
apicity anthropic v1.messages --data '{"model":"claude-sonnet-4-5","max_tokens":1024,"messages":[{"role":"user","content":"Draft a reply."}]}'
apicity anthropic v1.models.list --json
apicity anthropic v1.messages.countTokens --data '{"model":"claude-sonnet-4-5","messages":[{"role":"user","content":"How long is this?"}]}'
```

### xai — Grok chat, images, video, collections, batches

Image and video generation here are **paid**: say so before calling.

```bash
apicity xai v1.chat.completions --data '{"model":"grok-4","messages":[{"role":"user","content":"What changed today?"}]}'
apicity xai v1.languageModels --json
apicity xai v1.images.generations --data '{"model":"grok-2-image","prompt":"a lighthouse at dusk"}'
```

### fal — hosted model endpoints, queue, pricing and usage

```bash
apicity fal v1.models.pricing --json
apicity fal veo3p1.textToVideo --data '{"prompt":"a paper plane over a city"}'
apicity fal v1.models.usage --json
```

### kie — video, image, audio and music generation

Most generation rows here are **paid**: say so before calling, then create a
task and poll it.

```bash
apicity kie api.v1.jobs.createTask --data-file ./job.json
apicity kie api.v1.jobs.recordInfo --taskId <taskId> --json
apicity kie api.v1.chat.credit --json
```

### google — Gemini generateContent (express mode)

```bash
apicity google v1.publishers.google.models.generateContent --model gemini-2.5-flash --data '{"contents":[{"role":"user","parts":[{"text":"Hello"}]}]}'
apicity google v1.publishers.google.models.countTokens --model gemini-2.5-flash --data '{"contents":[{"role":"user","parts":[{"text":"Hello"}]}]}'
```

### googleflow — Google Flow video and image jobs

```bash
apicity googleflow v1.videos --data '{"prompt":"a slow pan over rooftops"}'
apicity googleflow v1.jobs.retrieve --jobId <jobId> --json
apicity googleflow v1.images --data '{"prompt":"a cat wearing sunglasses"}'
```

### fireworks — open-model inference, deployments, training

```bash
apicity fireworks inference.v1.chat.completions --data '{"model":"accounts/fireworks/models/kimi-k2-instruct","messages":[{"role":"user","content":"hi"}]}'
apicity fireworks inference.v1.embeddings --data '{"model":"nomic-ai/nomic-embed-text-v1.5","input":"hello"}'
```

### alibaba — Qwen chat, image and video generation

```bash
apicity alibaba compatibleMode.v1.chat.completions --data '{"model":"qwen3-max","messages":[{"role":"user","content":"hi"}]}'
apicity alibaba api.v1.services.aigc.imageGeneration.generation --data-file ./image.json
apicity alibaba api.v1.tasks --taskId <taskId> --json
```

### kimicoding — Kimi coding-plan chat, messages, embeddings

```bash
apicity kimicoding coding.v1.messages --data '{"model":"kimi-k2-thinking","max_tokens":1024,"messages":[{"role":"user","content":"Explain this stack trace."}]}'
apicity kimicoding coding.v1.models --json
```

### zaicoding — Z.ai coding-plan chat and usage

```bash
apicity zaicoding api.coding.paas.v4.chat.completions --data '{"model":"glm-4.6","messages":[{"role":"user","content":"hi"}]}'
apicity zaicoding api.monitor.usage.quota.limit --json
```

### elevenlabs — text to speech, sound effects, voices, transcription

```bash
apicity elevenlabs v1.textToSpeech --voiceId 21m00Tcm4TlvDq8ikWAM --data '{"text":"Your build is green.","model_id":"eleven_multilingual_v2"}'
apicity elevenlabs v1.soundGeneration --data '{"text":"distant thunder"}'
apicity elevenlabs v1.voices.list --json
```

### s3 — any S3-compatible object storage

`bucket` and `key` are request fields, so they are flags.

```bash
apicity s3 buckets.list --json
apicity s3 objects.put --bucket my-bucket --key reports/q3.pdf --data-file ./upload.json
apicity s3 objects.get --bucket my-bucket --key reports/q3.pdf --output-dir ./out
```

### b2 — Backblaze B2 through its S3-compatible API

```bash
apicity b2 buckets.list --json
apicity b2 objects.put --bucket my-bucket --key clips/take-1.mp4 --data-file ./upload.json
```

### dropbox — files, folders and shared links

```bash
apicity dropbox files.listFolder --data '{"path":""}'
apicity dropbox files.upload --data-file ./upload.json
apicity dropbox sharing.createSharedLinkWithSettings --data '{"path":"/reports/q3.pdf"}'
```

### free-media-upload — anonymous file hosts, no credential

Useful when a provider needs a public URL for a local file.

```bash
apicity free-media-upload tmpfiles.api.v1.upload --data-file ./upload.json
apicity free-media-upload catbox.upload --data-file ./upload.json
apicity free-media-upload litterbox.upload --data-file ./upload.json
```

### telegram — send messages, photos, video and audio from a bot

The `{token}` in the URL is supplied from the environment. Never pass it.

```bash
apicity telegram sendMessage --data '{"chat_id":123456789,"text":"Deploy finished."}'
apicity telegram sendPhoto --data '{"chat_id":123456789,"photo":"https://example.com/chart.png"}'
apicity telegram sendVideo --data '{"chat_id":123456789,"video":"https://example.com/clip.mp4"}'
```

### x — post to X, upload media, read the authenticated user

```bash
apicity x v2.users.me --json
apicity x v2.tweets --method POST --data '{"text":"Shipping today."}'
apicity x v2.media.upload.initialize --data '{"media_type":"video/mp4","total_bytes":1048576}'
```

### meta — post Instagram reels through the public-URL flow

```bash
apicity meta v25.media --igUserId <igUserId> --data '{"media_type":"REELS","video_url":"https://example.com/clip.mp4"}'
apicity meta v25.mediaPublish --igUserId <igUserId> --data '{"creation_id":"<containerId>"}'
apicity meta v25.container --containerId <containerId> --json
```

### youtube — upload videos and read channel data

```bash
apicity youtube videos.insert --data-file ./video.json
apicity youtube videos.list --data '{"part":"snippet,statistics","id":"<videoId>"}'
apicity youtube channels.list --data '{"part":"snippet","mine":true}'
```

### quo — business text messaging

```bash
apicity quo v1.messages --data '{"to":"+15555550123","body":"Your order is ready."}'
```

### binance — public spot market data, no credential

```bash
apicity binance api.v3.ticker.price --data '{"symbol":"BTCUSDT"}'
apicity binance api.v3.klines --data '{"symbol":"BTCUSDT","interval":"1h","limit":24}'
apicity binance api.v3.depth --data '{"symbol":"ETHUSDT","limit":50}'
```

### polymarket — prediction-market data and CLOB trading

Public market data needs no credential; trading needs the CLOB bundle.

```bash
apicity polymarket gamma.markets --json
apicity polymarket clob.book --data '{"token_id":"<tokenId>"}'
apicity polymarket data.trades --data '{"limit":20}'
```

### simplefunctions — market, portfolio and news data

```bash
apicity simplefunctions api.public.markets --json
apicity simplefunctions api.public.market.candles --ticker <ticker> --data '{"limit":100}'
apicity simplefunctions api.x.news --json
```

### dolthub — run SQL against a Dolt database

```bash
apicity dolthub api.v2.databases.sql.read --owner dolthub --database SHAQ --data '{"q":"select 1"}'
apicity dolthub api.v2.databases.sql.write --owner me --database mydb --data '{"q":"insert into t values (1)"}'
apicity dolthub api.v2.user.get --json
```

### openligadb — German football fixtures, tables and scorers

```bash
apicity openligadb getmatchdata.byLeagueSeason --leagueShortcut bl1 --leagueSeason 2025
apicity openligadb getbltable --leagueShortcut bl1 --leagueSeason 2025
apicity openligadb getgoalgetters --leagueShortcut bl1 --leagueSeason 2025
```

### openf1 — Formula 1 timing, telemetry and session data

```bash
apicity openf1 v1.sessions --data '{"year":2025}'
apicity openf1 v1.drivers --data '{"session_key":"latest"}'
apicity openf1 v1.laps --data '{"session_key":"latest","driver_number":1}'
```

### endless — TikTok and X trends by region, no credential

`--region` takes a slug (`thailand`, `united-states`, … and `worldwide` for X
trends); `describe` lists them all.

```bash
apicity endless social.tiktokTrends.public --region thailand --json
apicity endless social.trends.public --region worldwide --json
```

### tiktok-creative-center — TikTok Creative Center trending videos, no credential

Unofficial endpoints TikTok can change. Without a TikTok One session a list
holds the top 4 rows; `page` and `limit` are ignored.

```bash
apicity tiktok-creative-center ads.creativeOne.report.getTopContentsOverview --json
apicity tiktok-creative-center ads.creativeOne.report.creativeCenterGetTopContentsList --data '{"countryCode":"TH","periodDimension":3,"periodEndTimestamp":1792886400,"orderByMetric":1}' --json
```

### omkar — TikTok's trending and Explore feeds by country (Omkar Cloud TikTok Scraper)

Each call scrapes a fresh batch of up to 30 videos. The free plan allows 1,000
successful calls a month.

```bash
apicity omkar feed.trending --data '{"country":"TH"}' --json
apicity omkar feed.explore --data '{"country":"TH","category":"comedy"}' --json
apicity omkar feed.explore.categories --json
```

### thesportsdb — teams, leagues, events and results

The `{apiKey}` is part of the URL and is supplied for you.

```bash
apicity thesportsdb v1.lookup.team --data '{"id":"133604"}'
apicity thesportsdb v1.lookup.table --data '{"l":"4328","s":"2025-2026"}'
apicity thesportsdb v1.eventsnext --data '{"id":"133604"}'
```

### machgen — video generation, task status and assets

Video generation: `apicity machgen api.v0.generate --data-file request.json`.
Poll `apicity machgen api.v0.tasks --taskId <id>`, then download with
`apicity machgen api.v0.assets --taskId <id>`. Generation bills per second;
`apicity machgen api.v0.tasks.billing --taskId <id>` reads the final charge.
`task_type: "UPSCALE"` re-renders a finished task, named in `src_task_ids`,
at a higher `video_config.height`.

### nunchux — account credits and plan limits

```bash
apicity nunchux v1.credits --json
```

### wavespeed — media generation, polled by prediction id

Every WaveSpeed model call answers at once with a prediction id in `data.id`.
Poll that id at least 2 s apart until `data.status` is `completed`, when
`data.outputs` holds the results, or `failed`, `cancelled`, `timeout` or
`deleted`. Output URLs are temporary, so download what you keep.

```bash
apicity wavespeed api.v3.predictions.result --id <id> --json
```

## Credentials and configuration

Credentials are the operator's, not yours. `apicity` resolves them itself, for
the addressed provider only; for each variable the first source that has one
wins:

1. a value already set in the environment;
2. a literal in the env file — `--env-file <path>`, else `$APICITY_ENV_FILE`,
   else `~/.config/apicity/.env` when it exists;
3. an `op://<vault>/<item>/<field>` reference in the environment or the env
   file, resolved through 1Password's `op`;
4. the 1Password vault convention, when both `--op-vault <vault>` and
   `--op-token <token>` (or `$APICITY_OP_VAULT` and
   `$APICITY_OP_SERVICE_TOKEN`) are configured.

The vault and token usually live in that env file already: the operator saves
them once with `apicity setup 1password`, and every call uses them with no
flags. That is the operator's one-time command. Never run it yourself with a
literal token, and never pass `--op-token` on a call.

`apicity providers --json` reports which providers are configured, by variable
**name**, and `apicity doctor` checks the whole setup. Neither prints a value,
and neither should you. `configured: true` means the CLI knows where each
credential comes from. Whether the vault really holds it shows up only when
you call and in `apicity doctor`. Under the vault convention, an item the
vault lacks fails the call with `auth` (exit 3), naming the variable and the
`op://` reference it expected. For the four providers whose credential is
optional — `polymarket`, `simplefunctions`, `thesportsdb` and `youtube` —
the CLI skips that item instead. With none of their items in the vault,
their keyless endpoints still work and a keyed endpoint fails with the
provider's own error, as it would with no credential set. `apicity doctor`
names each item the vault lacks and labels the optional ones `(optional)`.

Other variables the CLI reads: `$APICITY_OUTPUT_DIR` and `$CLAUDE_PROJECT_DIR`
(where media lands), `$APICITY_PAYGATE_SECRET_FILE` (the operator's pay-gate
secret — never read it yourself), `$APICITY_PAYGATE_GRANT_DIR` (the operator's
provider grant directory — never read or print files inside it),
`$APICITY_PAYGATE_LEDGER_DIR` (the consumed-OTP ledger directory),
`$APICITY_SETUP_AGENT` (which agent `apicity setup agents` connects).
`apicity help environment` lists them.

| Provider                 | Credential variables (names only)                                                                                                                                                                                                       |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `openai`                 | `OPENAI_API_KEY`                                                                                                                                                                                                                        |
| `xai`                    | `XAI_API_KEY`                                                                                                                                                                                                                           |
| `anthropic`              | `ANTHROPIC_API_KEY`                                                                                                                                                                                                                     |
| `fireworks`              | `FIREWORKS_API_KEY`                                                                                                                                                                                                                     |
| `fal`                    | `FAL_API_KEY`                                                                                                                                                                                                                           |
| `google`                 | `GOOGLE_API_KEY`                                                                                                                                                                                                                        |
| `googleflow`             | `GOOGLE_FLOW_API_KEY`                                                                                                                                                                                                                   |
| `dolthub`                | `DOLTHUB_API_KEY`                                                                                                                                                                                                                       |
| `dropbox`                | `DROPBOX_OAUTH_TOKEN`                                                                                                                                                                                                                   |
| `simplefunctions`        | `SIMPLEFUNCTIONS_API_KEY` (optional; public rows work without it)                                                                                                                                                                       |
| `kie`                    | `KIE_API_KEY`                                                                                                                                                                                                                           |
| `kimicoding`             | `KIMI_CODING_API_KEY`                                                                                                                                                                                                                   |
| `alibaba`                | `DASHSCOPE_API_KEY`                                                                                                                                                                                                                     |
| `zaicoding`              | `ZAI_CODING_PLAN_API_KEY`                                                                                                                                                                                                               |
| `binance`                | none — public market data                                                                                                                                                                                                               |
| `openligadb`             | none — public data                                                                                                                                                                                                                      |
| `openf1`                 | none — public data                                                                                                                                                                                                                      |
| `endless`                | none — public data                                                                                                                                                                                                                      |
| `tiktok-creative-center` | none — public data                                                                                                                                                                                                                      |
| `elevenlabs`             | `ELEVENLABS_API_KEY`                                                                                                                                                                                                                    |
| `s3`                     | `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY`                                                                                                                                                                                              |
| `b2`                     | `B2_ACCESS_KEY_ID`, `B2_SECRET_ACCESS_KEY`, `B2_REGION`                                                                                                                                                                                 |
| `x`                      | `X_ACCESS_TOKEN`                                                                                                                                                                                                                        |
| `meta`                   | `IG_ACCESS_TOKEN`                                                                                                                                                                                                                       |
| `polymarket`             | none for public data; trading needs `POLYMARKET_CLOB_API_KEY`, `POLYMARKET_CLOB_API_SECRET`, `POLYMARKET_CLOB_API_PASSPHRASE`, `POLYMARKET_ADDRESS`, `POLYMARKET_PRIVATE_KEY`, `POLYMARKET_FUNDER_ADDRESS`, `POLYMARKET_SIGNATURE_TYPE` |
| `free-media-upload`      | none — anonymous hosts                                                                                                                                                                                                                  |
| `youtube`                | `YOUTUBE_ACCESS_TOKEN` (optional; public reads work without it)                                                                                                                                                                         |
| `telegram`               | `TELEGRAM_BOT_KEY`                                                                                                                                                                                                                      |
| `machgen`                | `MACHGEN_API_KEY`                                                                                                                                                                                                                       |
| `quo`                    | `QUO_API_KEY`                                                                                                                                                                                                                           |
| `omkar`                  | `OMKAR_API_KEY`                                                                                                                                                                                                                         |
| `wavespeed`              | `WAVESPEED_API_KEY`                                                                                                                                                                                                                     |
| `thesportsdb`            | `THESPORTSDB_API_KEY` (optional; the free tier works without it)                                                                                                                                                                        |

## Paid endpoints

Many endpoints bill real money: media generation, LLM calls, storage writes.
Each row's `billing` field is its reviewed billing kind, and `paid` is true for
every kind that bills:

- `metered`: billed per call, by images, seconds, tokens or requests. Paid.
- `accrual`: starts a charge that keeps running until it is stopped. Paid.
- `unpriced`: billed, at a rate nobody has priced yet. Paid.
- `free`: no charge.
- `followup`: a poll or read whose cost is billed on the submit it follows.
- `subscription`: a flat plan with no charge per call.

Every endpoint marked `paid: true` is also `gated: true` on an armed host, with
`gate` showing where the check runs (`"sdk"` for the `kie` and `xai` registry
rows; `"cli"` for every other paid row; `"none"` for unbilled rows). The CLI
derives all of this at runtime, so trust it rather than any static list:

```bash
apicity describe kie api.v1.jobs.createTask --json   # "paid": true, "gated": true, "gate": "sdk"
apicity describe openai v1.embeddings --json         # "paid": true, "gated": true, "gate": "cli"
apicity commands --provider xai --json               # each row carries "paid", "gated", "gate"
```

`paid: true` means the call bills, armed or not. A provider grant never changes
rule 6: always state the endpoint and that it bills before calling it, then call
it without a token:

```bash
apicity kie api.v1.jobs.createTask --data-file ./job.json
```

The pay gate is off unless the operator armed it by giving the CLI a secret
file (`--paygate-secret-file` or `$APICITY_PAYGATE_SECRET_FILE`), so that call
usually runs directly. On an armed host, **`gate: "cli"`** endpoints also run
without `--otp` when a valid operator-minted provider grant exists on disk (no
flag passes a grant — the CLI reads `$APICITY_PAYGATE_GRANT_DIR` or
`~/.config/apicity/paygate-grants` itself); **`gate: "sdk"`** endpoints (`kie`
and `xai` registry rows) never accept grants and still require a per-request
OTP. Grants are per provider for that host OS user until `--ttl` expires (`1h`
default, `24h` max) — reusable across calls, not single-use or per-session.
Two refusal answers mean something else:

- **`paygate`, with `otp-missing` or `grant-*` in `hint`.** The operator armed
  the gate (`grant-expired`, `grant-invalid-signature`, `grant-malformed`,
  `grant-not-yet-valid`, `grant-mismatched-provider`, `grant-unreadable`,
  `grant-unrecorded`, or `otp-*`). Report the exact `hint` (both the
  `apicity-paygate` mint/grant commands and `meta.requestHash`), and stop without
  reading secret or grant files so the operator can mint out of band (via
  `@apicity/cost` or `npx -p @apicity/cost apicity-paygate`).
- **`paygate`, with `paygate-not-configured` in `hint`, on a call where you
  passed an operator-supplied `--otp`.** This host has no gate armed, so the
  token cannot be checked. Report the unarmed host and stop. Never retry
  without the `--otp`: the operator meant that call to be gated.

**The operator mints the token or grant; you never do.** When an armed host
refuses a call, `hint` prints the complete `--request-hash` OTP command — and
for `gate: "cli"` rows, also the `apicity-paygate grant mint ... --grant-dir <dir>`
command (`APICITY_PAYGATE_GRANT_DIR` in the CLI's `.env` moves `<dir>` for the
CLI only) — and `meta.requestHash` carries the digest; `--payload-file` still
mints OTPs for single-object requests with no path parameters, and running the
caller's command without `--otp` lets the operator verify what `requestHash`
covers without calling upstream:

```bash
apicity-paygate otp mint --secret-file <path> --provider <provider> --method <M> --dot-path <api.path> --request-hash sha256:<hex>
```

If they give you an OTP token, pass it unchanged:

```bash
apicity kie api.v1.jobs.createTask --otp <token> --data-file ./job.json
```

An OTP token is bound to the exact endpoint and request — `--data` / `--data-file`,
path parameters (`--voiceId`), and request-field flags (`--bucket`, `--key`)
included — valid until expiry (`10m` default), and an OTP is spent across runs
by the first invocation that presents it (recorded under
`$APICITY_PAYGATE_LEDGER_DIR` or `~/.config/apicity/paygate-consumed/`; failed
calls still spend their OTP, and provider grants are never recorded or spent in
this ledger). Change any field — or retry after spending — and the operator must
mint again. If you have no token (and no valid grant applies), report the block
and `hint` and stop — never read the secret file or grant directory, and never
run `apicity-paygate` yourself.

## Troubleshooting

| Code               | Exit | What to do                                                                                                                       |
| ------------------ | ---- | -------------------------------------------------------------------------------------------------------------------------------- |
| `usage`            | 1    | Read the `hint` — it names the flag. Then `apicity describe <provider> <dotPath> --json` and pass exactly the listed parameters. |
| `not_found`        | 2    | The provider or dotPath does not exist: `apicity commands --provider <provider> --json` and pick the real row.                   |
| `ambiguous`        | 8    | The dotPath answers several methods; add `--method GET` (the `hint` and `meta.methods` list them).                               |
| `auth`             | 3    | Blocked. Report which variable the operator must set; never look for the key yourself.                                           |
| `forbidden`        | 4    | The credential is valid but not allowed this call. Report it; do not retry.                                                      |
| `paygate`          | 4    | `otp-*` in `hint`: gate armed; await the operator's OTP. `paygate-not-configured`: unarmed host; stop, never retry without it.   |
| `rate_limit`       | 5    | Wait out the provider's window, then retry once. Do not loop.                                                                    |
| `network`          | 6    | The request never landed. Retry once; if it persists, report it with the `error` text.                                           |
| `api`              | 7    | The upstream failed, or a local step did. `meta.status` carries the HTTP status when there was one.                              |
| `setup_incomplete` | 7    | A package or agent is missing; the `hint` names the step to run.                                                                 |
| `skill_unmanaged`  | 1    | Something apicity did not write occupies the skill path. Report it; do not delete the user's files.                              |

Other things worth knowing:

- **`--verbose` prints the HTTP exchange to stderr** without touching the
  document on stdout, which is the fastest way to see what a provider actually
  received.
- **A missing parameter is a `usage` error, not a silent default.** The hint
  distinguishes the two kinds: `--taskId is required (path parameter {taskId})`
  versus `--bucket is required (request field bucket)`.
- **`--data`, `--data-file` and `--data -` are alternatives**, and flags merge
  over the body: `--bucket x` and `--data '{"bucket":"x"}'` are the same
  request.
- **Media is already saved.** Use the `savedTo` path or the `<key>_savedTo`
  sibling; re-downloading the URL wastes a round trip and can fail, because
  many providers expire those links within hours.
- **Nothing reads stdin except `--data -`**, so a command never hangs waiting
  for input.

### Opt-in HAR capture

For diagnostics, add endpoint-only `--capture-har [all|failures]` (bare means
all), or set `APICITY_HAR_CAPTURE=all|failures|off`; the flag wins and the
default is off. `APICITY_HAR_DIR` defaults to `$HOME/.config/apicity/har`.
Saved calls expose `meta.har`; `--verbose` prints the path. Inspect local
captures with `apicity har list` and `apicity har show <file|callId> --bodies`;
run `apicity har scrub <file...> --check` before sharing, and omit `--check`
to scrub in place. `apicity doctor` reports capture settings and writability.
Captures retain prompts and responses; known credential fields are scrubbed,
so review for other private data before sharing. Media downloads are excluded.

### HAR learning reports

Run `apicity har report <path...> [--provider fal,kie] [--endpoint dot.path]
[--since iso] [--baseline dir | --no-baseline] [--json]` to analyze captures or
legacy HAR recordings offline. Extract archives first. Output is Markdown even
when redirected; `--json` emits `{ok: true, data: ...}` with `schemaVersion: 1`.
Reports group errors, compare real request schemas, summarize defaults and
response drift, and include local failures. Nothing is sent to a provider.
See [the report contract](../../docs/har-capture.md#learning-report) for units,
filters, baseline rules and unavailable sections.

### HAR cost reports

Run `apicity har cost <path...> [--provider fal,kie] [--endpoint dot.path]
[--model m] [--since iso] [--tolerance 0.02] [--json]` to see what calls actually
cost and how many tokens they used, per provider, endpoint and model, from captures
or legacy HAR recordings. Output is Markdown even when redirected; `--json` emits
`{ok: true, data: ...}` with `schemaVersion: 1`. Equal inputs give equal bytes.
The report sets each call's quote, or today's tables when no quote was stored,
against its actual, and it lists rate corrections that a provider's stated charges
point to, as leads to check. Nothing is sent to a provider. See
[the report contract](../../docs/har-capture.md#cost-report).

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.