APIMatic SDK Skill
Let your AI coding assistant generate, validate, and publish APIMatic SDKs.
The apimatic-sdk skill turns your AI coding assistant into a guided SDK builder. Describe what you want, and the agent signs you in to the APIMatic CLI, generates the SDK, and publishes to a package registry or GitHub, all from within Claude Code, Cursor, or Codex.
What the skill does
| Area | What the skill covers |
|---|---|
| Setup | Checks for Node.js 24 and APIMatic CLI v2 (and offers to upgrade from v1), signs you in through the browser with an API key fallback |
| Project setup | Creates the src directory with your API definition in src/spec/ |
| SDK generation | Generating SDKs in C#, Python, and TypeScript with the right flags for destination and stability |
| Validation and transformation | Running apimatic api validate when generation reports errors in your API definition, and apimatic api transform to convert formats |
| Customization | Generating with --git-init so changes to the SDK survive regeneration, adding custom code, and recording each change in the SDK README |
| Publishing | Listing publishing profiles and publishing to NuGet, PyPI, npm, or GitHub |
If you ask for a Java, PHP, Ruby, or Go SDK, the skill tells you the language isn't available yet and offers C#, Python, or TypeScript instead.
When the agent uses this skill
The agent activates apimatic-sdk automatically when you ask about:
- Generating or downloading an SDK with the APIMatic CLI
- Adding custom code to a generated SDK
- Validating or converting your API definition before generating
- Publishing an SDK, or listing publishing profiles
Use the skill
After you install the skill, open your project in Claude Code, Cursor, or Codex and describe what you want.
Example prompts
Generating an SDK:
"I have an OpenAPI definition at
./spec.yaml. Generate a TypeScript SDK for it."
Adding custom code:
"Add a helper to my Python SDK that retries rate-limited calls, and keep it when the SDK is regenerated."
Publishing:
"Publish version 1.2.0 of my TypeScript SDK to npm and GitHub using my publishing profile."
What happens behind the scenes
For a first-time generation, the agent:
- Checks for Node.js 24 and APIMatic CLI v2, and installs or upgrades the CLI if needed.
- Signs you in through the browser, with an API key fallback.
- Sets up
src/spec/with your API definition if you're starting from scratch. - Asks for the language and destination.
- Runs
apimatic sdk generatewith the chosen language and flags. - Shows you the CLI output and where the SDK was written, for example
./sdk/typescript.
For later requests (regenerating, adding custom code, or publishing), the agent runs the right commands without asking again for details you've already given.
Adding custom code
The SDK generator has no configuration settings, so every change to a generated SDK is a code change. If you generate the SDK with --git-init, those changes are kept, because each regeneration merges them into the new SDK.
Whether you or the agent add the code, the skill follows these guidelines:
- Generate the SDK with
--git-initbefore making the first change. - Put larger additions in new files that import the generated code. This makes conflicts with the generator's changes less likely.
- Describe every customization in the SDK's
README.md, so future developers know what you added and why.
See Customize SDKs.
Publishing an SDK
The agent publishes only when you explicitly ask it to. A request like "generate an SDK for npm" stops at generation.
To publish, the agent:
- Lists your publishing profiles with
apimatic publishing profile listand asks you to pick one. If you don't have one yet, it explains how to create one in the Publishing Center on the APIMatic Dashboard. - Runs
apimatic sdk publishwith your profile ID, language, semantic version, and publish type:packagefor NuGet, PyPI, or npm,sourcecodefor GitHub, or both. - Shows you the link to the publishing logs, whether publishing succeeded or failed.
A successful publish also records the release in the languages block of src/apimatic.json, so an APIMatic portal built from the same project shows the install command, package, and repository on that language's SDK card.
If you plan to build a Context Plugin, ask the agent to publish with source code (sourcecode), because the plugin references your SDK repositories.
See Publish SDKs.
Troubleshooting
Sign-in fails
Check that your APIMatic account is active and your API key is correct. If browser sign-in doesn't work, ask the agent to sign in with an API key instead. You can create one in the APIMatic Dashboard under Account > API Keys.
In CI or containers, keep the key in a secret and pass it to the command, for example --auth-key="$APIMATIC_API_KEY". The CLI doesn't read the key from an environment variable on its own. sdk publish has no --auth-key flag, so sign in first with apimatic auth login --auth-key=....
The CLI refuses to run
The APIMatic CLI needs Node.js 24 or later. npm lets the install finish on older versions, but the CLI won't start. Install Node.js 24 from nodejs.org and try again.
Generation reports errors in the API definition
The agent runs apimatic api validate and explains the errors. Blocking issues and errors must be fixed before an SDK can be generated; warnings don't block generation but can lower SDK quality. See Validate & Lint.
An SDK already exists at the destination
If the SDK was generated with --git-init, regenerating it merges your changes into the new SDK instead of overwriting it. Otherwise, the agent asks whether to overwrite it, then re-runs the command with --force, or uses a different destination.
Regeneration reports conflicts
When the agent runs the CLI, the CLI can't ask how to resolve conflicts, so it lists the conflicting files and stops without writing anything. To choose how they're resolved, run the command in your own terminal. You can also ask the agent to rerun it with --force, which resolves them using the generator's changes. See Resolve conflicts.
Publishing stays queued for a long time
Don't cancel or re-run the command. The queued state is normal and resolves on its own. Act only if the CLI exits with an error.