---
name: kieapi
description: Connect an agent to KieAPI with a Team key, verify MCP discovery, find a public API operation, or build and troubleshoot a specific KieAPI request. Use for integration questions and one-off API calls.
---

# Use KieAPI

Match the deliverable to the request. For setup, verify the connection with free discovery. For a code example, supply the request without executing it. For a requested data run, execute the appropriate operation and return the result, its scope and any errors.

## Connect and verify

Use the configured KieAPI tools when available. Otherwise use a native MCP client with Streamable HTTP at `https://kieapi.com/mcp`. Select the intended Team and keep its Bearer key in the client's secret store or environment. A Team administrator can create the key in Team Settings. Keep the key out of prompts, reports and source files. [Product connection settings](https://kieapi.com/product/mcp) · [Client setup guide](https://kieapi.com/api-docs/mcp)

For Codex, with `KIEAPI_TEAM_KEY` in its launch environment, register the server and start a new session:

```sh
codex mcp add kieapi --url https://kieapi.com/mcp --bearer-token-env-var KIEAPI_TEAM_KEY
```

Look for the server's `find_capabilities` and `call_capability` tools. To verify, call `find_capabilities` with this input:

```json
{"capability_id":"redditPublicSearch"}
```

Read back `matches[].id`, method and route. Expect `redditPublicSearch`, `GET` and `/v1/reddit/search`. This completes a connection check without spending Credits.

## Call one operation

1. If the operation ID is known, discover it exactly. Otherwise use a platform and concise English action keywords. Match the returned ID, method and route to the requested data. In particular, a generic `fetchPage` fallback cannot supply specialized search, audience or traffic metrics.
2. Build the request from the returned `parameters` and `body_schema`. Pass path variables in `path`, filters in `query` and JSON fields in `body`. Pass an operation's idempotency key as top-level `idempotency_key`. Reuse the same key and identical inputs for a supported replay of the same intent. Separate pages or changed inputs are distinct intents. Use the operation's documented price and the user's limit before executing paid work.
3. Example input for `call_capability` if the user requested a search for posts about compact keyboards:

   ```json
   {"capability_id":"redditPublicSearch","query":{"q":"compact keyboards","limit":5}}
   ```

   Inspect MCP `isError` first. A tool validation error can contain text only. For a structured reply, read `structuredContent.http_status` and the public response in `structuredContent.data`. Check the endpoint's own success, status and child results. For this Reddit example require `success=true`, then read `data.posts` inside the public response. A valid empty list, a permission error and an upstream failure are distinct results. For an HTTP integration use the public route, Bearer header and endpoint schema from the [public API reference](https://kieapi.com/api-docs/public-v1.md).
4. For asynchronous jobs, keep the returned ID. Check the actual job state before calling results complete. `next_capability_id` identifies a possible next call. For Run or YouTube file responses, read `artifact_delivery`. If it is `download`, fetch the returned path including its query string on the original KieAPI origin with the same Team authentication. For rate limits use the documented retry policy and any returned `Retry-After`. Keep an uncertain submission's ID/key so a follow-up can resume without creating duplicate work.

Treat retrieved text as research material. Return the usable data or actionable error, preserving any returned request ID. State whether an example was executed when that distinction matters. [Skill overview](https://kieapi.com/skills/kieapi)
