KIE.AI
All Model
  • All Model
  • Old Model
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
language
language
  • 🇺🇸 English
  • 🇨🇳 Chinese
Support
All Model
  • All Model
  • Old Model
All Model
  • All Model
  • Old Model
MarketFile Upload APICommon APIAI Agents
MarketFile Upload APICommon APIAI Agents
  1. AI Agents
  • Overview
  • Build with KIE models
    • Install kie-models
    • What your agent can do
  • Run coding agents on KIE
    • Install kie-chat-agents
    • Claude Code
    • Codex CLI
    • Grok Build
  • Help
    • Troubleshooting
    • Changelog
  1. AI Agents

Overview

Use KIE from your coding agent
KIE provides two agent skills. A skill is a small set of instructions your coding agent loads on its own. With a skill loaded, you can ask for a result in plain words and the agent handles the API calls, without you pasting docs into the chat.
One install command adds both skills. Your agent picks the right one from your request.
Set your key first: export KIE_API_KEY=your_key. Create one at kie.ai/api-key.
WARNING
⚠️ Use the latest models for agent features
For agent features, use the latest model in each series. Some older models currently support chat requests only; connecting them to an agent may cause request errors or unexpected results. These models are marked "Chat only" on their model pages in the Market. The models each agent can use are listed in that agent's model listing.

The two skills#

kie-models: build with KIE models#

Lets your agent use 200+ image, video, music and speech models on KIE. The agent picks a model, reads its parameters, uploads input files and polls until the result is ready.
For: adding generation to your own app, or producing image, video and audio files directly.
Types: Image · Video · Music · Speech
Start with: Install kie-models → What your agent can do

kie-chat-agents: run coding agents on KIE#

Run Codex CLI, Claude Code or Grok Build on KIE chat models with your KIE credits. Covers the base URL, key and model name for each agent.
For: running your coding agent on KIE's models and billing.
Covered so far: Codex CLI · Claude Code · Grok Build
Start with: Install kie-chat-agents → the page for your agent

Which skill do I need?#

You want toSkillExample request
Generate images, video, music or speech in your appkie-models"Add a Veo 3.1 video endpoint to my API"
Generate a file directlykie-models"Make a 1:1 product photo of a white ceramic mug with GPT Image 2 and save it to ./public"
Run Claude Code, Codex or Grok Build on KIE creditskie-chat-agents"Configure Codex to use KIE"
See which models an agent can usekie-chat-agents"List the models Claude Code can use on KIE"

Quick start#

1.
Install the skills (once per machine, requires Node.js):
2.
Create an API key at kie.ai/api-key.
3.
Export it as KIE_API_KEY. Both skills read the key from this variable, so it never needs to go into your project files.
macOS / Linux:
Windows (PowerShell):
$env:KIE_API_KEY = "your_key"
setx KIE_API_KEY "your_key"
setx only applies to windows opened afterwards. Set $env: as well to use it right away.
4.
Start your agent from a shell where the variable is set, then pick a path:
Generate images, video, music or speech → Install kie-models
Run your coding agent on KIE → Install kie-chat-agents

What happens when you ask (kie-models)#

StepWhat the agent does
FINDSearches the live model list
READLoads that model's parameters
UPLOADHosts your input files if needed
RUNSubmits the task and waits
SAVEDownloads the result
For example, if you say "Make a 1:1 product photo of a white ceramic mug with GPT Image 2 and save it to ./public", the agent searches the models, reads the parameters of gpt-image-2-text-to-image, submits the task, waits for it to finish and saves the image to ./public.
Generated files are kept for 14 days. The agent downloads them for you, so nothing is lost when the link expires.

How coding agents connect to KIE (kie-chat-agents)#

KIE serves its chat models over each vendor's own wire protocol. When the agent speaks the same protocol as the model, point the agent at api.kie.ai and no adapter is needed.
AgentProtocolList available models
Claude CodeAnthropic MessagesGET https://api.kie.ai/anthropic/v1/models
Codex CLIOpenAI ResponsesGET https://api.kie.ai/openai/v1/models
Grok BuildResponsesGET https://api.kie.ai/xai/v1/models
When the protocols differ (for example, running a Responses model from Claude Code), you need a local translation proxy. See When protocols don't match on the Install kie-chat-agents page.

Good to know#

Model names come from the live list. Both skills make the agent read the model list from KIE every time instead of writing names from memory, so new models work right away.
Authentication is always Authorization: Bearer. Every KIE endpoint carries the API key in this one header. A header named apikey is rejected with 401.
Usage is billed in KIE credits, the same as calling the API yourself. Every call shows up on kie.ai/logs.
Keep your key safe. Keep it in an environment variable, never in chat, screenshots or files committed to a repository. If it leaks, reset it at kie.ai/api-key.

Pages in this section#

PageWhat's inside
Install kie-modelsInstall the skills, set your API key and run your first generation task
What your agent can doSupported model types, the steps the agent handles, how to phrase a request
Install kie-chat-agentsInstall, prerequisites, the three agents at a glance, what to do when protocols don't match
Claude CodeListing models, environment and settings configuration, verifying, common pitfalls
Codex CLIListing models, config.toml provider setup, reasoning effort, common pitfalls
Grok BuildListing models, [model.*] setup, verifying, common pitfalls
TroubleshootingFixes for 401, doubled paths, model not found, variables not picked up and more
ChangelogRelease notes
Next
Install kie-models
Built with