/gateway-ai:gateway-client-imglyfrom gateway-ai
Build IMG.LY-hosted apps that call the IMG.LY AI Gateway using the end user's IMG.LY/Clerk session — no API key on the client, no token-mint backend. Activate ONLY when the user is building inside the IMG.LY hosted app surface (e.g. an app deployed under `*.img.ly`, an IMG.LY-managed Clerk session, or explicitly mentions wanting to authenticate gateway calls with a Clerk JWT issued by IMG.LY's auth setup). For external integrators bringing their own auth, use the `gateway-client` skill instead.
Ships in gateway-ai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are helping a developer who is building an app hosted by IMG.LY (deployed under the IMG.LY product surface, using IMG.LY's Clerk-managed end-user auth). This is a narrow audience — it does not apply to external integrators using the gateway from their own infrastructure.
If you are not sure the user is in this audience, stop and use the gateway-client skill instead. That skill covers the standard integration paths (API key, gateway JWT mint flow) used by the vast majority of integrators.
Activate only when all of the following are true:
https://gateway.img.ly from the client using the user's session JWT directly.If the developer is bringing their own API key, building outside the IMG.LY hosting surface, or running their own backend that mints gateway JWTs, this skill does not apply — point them at the gateway-client skill.
The user's session is represented by a Clerk-issued JWT. The gateway accepts these JWTs and bills generation against the user's IMG.LY account.
The client sends the Clerk session JWT directly to the gateway:
Authorization: Bearer <clerk-session-jwt>
There is no token-mint hop, no POST /v1/tokens, no API key on the client.
import { useAuth } from "@clerk/clerk-react"; // or your framework's Clerk SDK
function useGatewayFetch() {
const { getToken } = useAuth();
return async function gatewayFetch(path: string, init: RequestInit = {}) {
const token = await getToken(); // Clerk session JWT
const headers = new Headers(init.headers);
headers.set("Authorization", `Bearer ${token}`);
headers.set("Content-Type", "application/json");
return fetch(`https://gateway.img.ly${path}`, { ...init, headers });
};
}
For server-side rendering or server actions, retrieve the token from the Clerk server SDK (auth().getToken() in Next.js, equivalent helpers elsewhere) and forward it on the gateway request.
Everything else: endpoints, request shapes, SSE event names, error codes, schema-driven inputs, model discovery, asset upload flow, and picking a long-running generation up again by its request_id (GET /v1/responses/<request_id>, with the same session JWT).
For all of those, fetch the live reference:
WebFetch https://gateway.img.ly/llms.txt
That document is the source of truth for endpoints and SSE — read it before answering specific questions about generation, models, schemas, or uploads. The only thing that document does not cover is the Clerk JWT auth path described here, because that path is specific to the IMG.LY hosting surface and not part of the public integration guide.
getToken() handles refresh automatically when called per-request — don't cache it across long-running operations.provider_not_authorized, the gateway is signalling that this user's account is not entitled to call that model — surface a clear error rather than retrying.insufficient_credits (402) as an account-level state and direct the user to the IMG.LY dashboard to top up.sk_...) in this kind of app. This auth model exists specifically so that you don't need to. If you find yourself reaching for POST /v1/tokens, you're in the wrong skill — the user is probably in the standard integration path and gateway-client applies.gateway-client.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
2 skills in this plugin
npx claudepluginhub imgly/gateway-ai-skills --plugin gateway-ai