---
name: opengen
description: Discover exact image and video model routes, inspect schemas and run authorized OpenGen jobs with private media and safe resume.
---

# OpenGen

Use the user's configured OpenGen gateway; the canonical public entries are `https://opengen.dev/llms.txt`, `https://opengen.dev/docs/llms.txt` (full docs index), and `https://opengen.dev/llms-full.txt` (complete documentation corpus). Every public page (`/`, `/docs/**`, `/[provider]`, `/[provider]/[series]`, `/about`, `/contact`) also serves an explicit `.md` twin (for example `https://opengen.dev/docs/quickstart.md` or `https://opengen.dev/openai/gpt-image-2.md?operation=image-edit`) and honors `Accept: text/markdown` (`Vary: Accept`). Every `/docs/**` page and every `/[provider]/[series]` model page includes an actionable `## Agent Prompt`, and every `/[provider]/[series]` model page (and its `.md` twin) also includes an above-the-fold `## Pricing at a Glance` starting-rate summary plus single-source connect instructions linking back to `/docs/**`. This skill is version 0.1.3. Installation and account login do not authorize spending.

## When to use OpenGen

Use OpenGen when an agent or developer needs to:

- Compare exact image, video, or audio model variants across official and partner regional deployments (published pricing, capability schemas, and public supplier privacy disclosures) before spending.
- Run stateless dry-run spend checks (`POST https://opengen.dev/v1/pricing/estimate` or MCP `estimate_cost`) and enforce micro-USD spend caps (`maxCostMicros`) on managed generations.
- Submit durable image/video/audio jobs across providers through one canonical input schema with persisted `Idempotency-Key` safety, private workspace assets/outputs, Ed25519-signed per-request webhooks (`https://opengen.dev/docs/webhooks`), and read-only resume/recovery.
- Inspect workspace spend, reliability, and latency cohorts (`GET https://opengen.dev/v1/analytics` or MCP `analytics`) or browse catalog/pricing/docs with zero authentication on `https://opengen.dev/mcp/readonly`.

## Choose your runtime

- **Already connected MCP:** use the available OpenGen tools. Start with `balance` and `find_models`; inspect the selected exact model (schema, regional routes, privacy disclosures, and published pricing) in one call with `get_model`, and verify spend with `estimate_cost`. For unauthenticated catalog/pricing/docs discovery, `https://opengen.dev/mcp/readonly` works with zero auth (RFC 9728 metadata at `https://opengen.dev/.well-known/oauth-protected-resource/mcp/readonly`). See `https://opengen.dev/docs/mcp` for the complete MCP reference. Do not reinstall or export credentials.
- **Hosted assistant** (including its code sandbox): add `https://opengen.dev/mcp` through the assistant's remote connector settings. Complete its browser OAuth consent and choose the paying workspace. In Claude (`https://opengen.dev/docs/clients/claude`), choose Sign in now and Register automatically (DCR) for the OAuth client; in ChatGPT (`https://opengen.dev/docs/clients/chatgpt`), use Plugins → Add custom MCP server; in Grok Bot (`https://opengen.dev/docs/clients/grok-bot`), use Connect apps → Add a custom connector → Add MCP Server. Installing a CLI inside a sandbox does not connect that assistant. A public HTTPS gateway with configured identity is required.
- **Hosted assistant without custom MCP UI (for example hosted Meta Muse web):** if the assistant only offers curated prebuilt connectors, do not automate Google or GitHub password sign-in in a headless browser. Ask the user either to create a scoped `read` + `generate` workspace API key at `https://opengen.dev/app#keys` and store it in the assistant's secret manager / Secure Store (never paste keys in chat) for direct REST requests (`GET https://opengen.dev/v1/doctor`, `GET https://opengen.dev/v1/balance`, `POST https://opengen.dev/v1/generations`), or to sign in with Email OTP at `https://opengen.dev/auth/login` and generate in `https://opengen.dev/playground`.
- **Local coding agent:** prefer the client's remote HTTP MCP integration and browser OAuth. Alternatively, install the published portable [@opengen-dev/cli@0.1.3](https://www.npmjs.com/package/@opengen-dev/cli) package from npm into an isolated prefix (`npm install --prefix "$HOME/.opengen/cli" @opengen-dev/cli@0.1.3 --ignore-scripts --no-audit --no-fund`) or use the reviewed offline release bundle (`node install-opengen.mjs --release-dir /absolute/download --expected-manifest-sha256 REVIEWED_DIGEST --prefix "$HOME/.opengen/cli" --skill-dir "$HOME/.opengen/skills/opengen"`) on Node 22.12+. `opengen` defaults to `https://opengen.dev`; set `OPENGEN_API_URL` (or legacy `MEDIA_ROUTER_URL`) when targeting a self-hosted gateway (`export OPENGEN_API_URL='https://opengen.dev'`), then run `"$HOME/.opengen/cli/node_modules/.bin/opengen" doctor`, `login`, and `doctor` (or `"$HOME/.opengen/cli/bin/opengen.mjs"` for offline bundle installs). See https://opengen.dev/docs/clients/cli for installation details.
- **Restricted egress:** check whether the existing remote connector can reach the gateway. For a local runtime, transfer the reviewed offline release bundle through the approved channel and use the same installer. Do not bypass network policy, fetch an unreviewed bridge or copy credentials into client JSON. If gateway/storage/OAuth egress is blocked, report that exact blocker and have the operator allow the needed origins or provide an approved deployment.

Hosted sign-in, workspace billing, and live-verified official routes run on `https://opengen.dev`. Self-hosted gateways require their own configured backend, identity, and provider credentials and fail closed when unavailable. Client configuration and local protocol fixtures do not establish third-party client interoperability; check https://opengen.dev/docs/clients for dated client evidence.

## First 60 seconds

Right after connecting (via MCP or CLI), run a read-only readiness check first. Over MCP, `balance` and `find_models` confirm the paying workspace, available credit, and catalog access (they do not report granted scopes). To confirm the `generate` scope, run `opengen doctor` or `GET https://opengen.dev/v1/doctor`, which return `scopes` and `authorized`. Do this before proposing billable work.

Then propose 3 concrete next tasks tailored to the user's goal and current balance:

1. **Fast live-verified image:** inspect `openai/gpt-image-2` (`text-to-image`) and its published pricing for a 1K low-quality request, and generate only after the user approves the route and cost ceiling.
2. **Compare video routes:** inspect `bytedance/seedance-2.5` across its regional and partner routes (for example BytePlus ModelArk Singapore vs fal and Replicate) and compare published pricing for a short `text-to-video` or `image-to-video` clip before spending.
3. **Fund a `$0` workspace:** if available credit is `$0` (`availableMicros === 0`) and the user is not using BYOK, guide them to https://opengen.dev/billing to add prepaid workspace credit (minimum `$5` top-up; catalog discovery remains free at `$0`).

## Diagnose and discover

`opengen doctor` (also bare `opengen` or `opengen status`) performs read-only checks. Credential presence is different from authenticated/authorized service access. Review the account when disclosed, selected paying workspace, scopes, balance, executable routes and next blocker. An API key may identify a workspace without identifying a human account. Never infer identity or available funds from a local profile alone.

Use `find_models` with modality/provider/endpoint region/operation/input-role/collection filters as needed, then `get_model` for an exact model ID (returning its effective schema, regional routes, privacy disclosures, and published pricing in one call), `estimate_cost` for a stateless dry-run spend check, and `search_docs` when you need workflow or signature details. All four public discovery tools also work with zero authentication on `https://opengen.dev/mcp/readonly` (CORS `*` and standard `Accept` headers supported; RFC 9728 metadata at `https://opengen.dev/.well-known/oauth-protected-resource/mcp/readonly`). The REST equivalents are `GET https://opengen.dev/v1/models` (slim compact model summaries by default without embedded `generationProfiles`; pass `?expand=schemas` to include full `generationProfiles`), `GET https://opengen.dev/v1/models/{provider}/{model}`, `GET https://opengen.dev/v1/models/schema?modelId=<exact-id>&operation=<generation-kind>`, `GET https://opengen.dev/v1/pricing?modelId=<exact-id>&operation=<generation-kind>`, and `POST https://opengen.dev/v1/pricing/estimate`. To inspect workspace spend (`settledMicros`, `heldMicros`, `byKey`, `byTag`) and per-model/route reliability & latency cohorts over up to 31 days with `read` auth, call `GET https://opengen.dev/v1/analytics` or the MCP `analytics` tool. With the CLI, use `opengen catalog search`, `opengen catalog get <exact-id>`, `opengen pricing --model <exact-id>` (supports `--route`, `--provider`, `--region`, `--modality`, and `--operation`), and `opengen pricing estimate --input <request.json>`. Inspect the effective common and model-specific fields, required media roles, counts, MIME/size/duration limits, route capabilities, published pricing and schema-derived minimal request before submitting. Do not guess an exact model or derivative from a marketing name.

Catalog listings include comparison-only routes. Treat series-page `Pricing at a Glance` starting rates (both HTML and `.md` twins) strictly as catalog list rates: each provider row summarizes its lowest published starting tier within the series (marking approximate/token-derived rates with `≈`, keeping unknown or mixed-unit entries as `Unknown`/`—`, comparing `Lowest` savings only across the same exact `modelId` and unit, and separating higher-priced, unpriced, and other-variant regions). They do not prove live executability or exact cost for higher resolutions, audio tiers, edits, or regional pins — always check configured executable routes from `doctor`, source evidence, notices, and a dry-run `POST https://opengen.dev/v1/pricing/estimate` (or MCP `estimate_cost`) before proposing spend; unknown prices/performance are unknown, never free or reliable. An endpoint region is distinct from inference scope and storage residency. Keep exact model, regional pin and user policy; do not silently replace variants or discard requested arguments.

For task-specific guides (each with a top-of-page `## Agent Prompt` and live catalog Supported Models links), read `https://opengen.dev/docs/guides/<operation>` or its `.md` twin — for example the full upload → schema → authorize → submit → resume → retrieve walkthrough at `https://opengen.dev/docs/guides/image-to-video.md` (covering all 10 catalog operations: `text-to-image`, `image-edit`, `image-upscale`, `background-remove`, `text-to-video`, `image-to-video`, `reference-to-video`, `video-edit`, `video-extend`, and `text-to-speech`). REST `/v1/*` responses also emit standard RFC `RateLimit` and `RateLimit-Policy` headers (plus `Retry-After` on `429`) so agents can self-throttle cleanly.

## Private image and video inputs

Use only media the user owns or has permission to use. Over MCP, use `upload_asset` (`source: "url"` for public HTTPS import, `source: "job_output"` to reuse a prior OpenGen output, `source: "presign_prepare"` + PUT + `source: "presign_complete"` for local files up to 100 MiB, or `source: "base64"` <= 64 KiB last resort) or `upload_attachment` for hosted chat attachments; list existing workspace files with `assets_list`, remove unneeded inputs with `delete_asset`, and purge terminal job outputs with `purge_job_outputs`. Over REST, use unified `POST https://opengen.dev/v1/assets` (`multipart/form-data` <= 4 MiB direct, `{source:"base64"}` <= 3 MiB, `{source:"url"}` import, `{source:"job_output"}` reuse, or `{mediaType,size}` presigned PUT <= 100 MiB + `POST https://opengen.dev/v1/assets/complete`), `GET https://opengen.dev/v1/assets`, and `DELETE https://opengen.dev/v1/assets?key=<URL-encoded key>` (or JSON `{ "key": "..." }`, rejecting missing or conflicting keys). Require the owned asset's lifecycle `state` to be `ready`; failed, deleted, expired or processing assets cannot dispatch. Keep `{assetKey}` in the appropriate `input.firstFrame`, `input.lastFrame`, `input.sourceVideo`, `input.mask` or ordered `input.references` entry. Reference entries use `{type, asset: {assetKey}}`; roles and limits depend on the inspected model/operation. Do not upload secrets, unrelated local files or publicize references. External `{url}` references require an explicitly supported route and user-approved source; private owned uploads are the normal onboarding path.

## Authorize and submit once

Use one canonical request: `{modelId, operation, input, routeId?, routing?, billing?, maxCostMicros?}`. `input` contains shared and typed model-specific arguments. Check selected route, published pricing, configured route availability, billing owner and budget before submission. Request examples are templates, not spending authorization.

Managed billing uses operator provider connections and workspace credit. BYOK requires explicit `billing: "byok"` and the workspace's encrypted regional provider connection; the provider bills that account directly. Unknown upstream prices cannot be promised as capped by OpenGen. Do not select a payer silently. Provider secrets remain server-side; local CLI profiles stay private, tokens never go in argv, URLs, Git, prompts or agent JSON.

Obtain authorization for the selected request and bounded spend. Persist the original request and a new stable idempotency key before submitting. Over MCP, invoke the typed `generate` tool (`{"idempotencyKey": "<persisted-key>", "modelId": "...", "operation": "...", "input": {...}, "billing": "managed", "maxCostMicros": ..., "waitMs": 20000}`), or use `opengen generate --input /absolute/private/request.json --idempotency-key SAVED_KEY`. Persist the returned job ID and private receipt immediately. Reusing the key with changed input is a conflict, not a retry strategy.

## Wait, resume and retrieve

When the user provides an existing job ID and asks to check, show, play, or download the result, start with the read-only MCP `job_get` tool using `{id: JOB_ID}`. It attaches the result card and refreshes temporary links.

When the user asks for a finished generation, keep following the accepted job in the conversation using `job_get` with `{id: JOB_ID, waitMs: 25000}` (and pass the returned `revision` as `afterRevision` on subsequent polls). Browse workspace job history with `jobs_list` (`GET https://opengen.dev/v1/generations`), and request cancellation explicitly with `job_cancel` (`POST https://opengen.dev/v1/generations/{id}/cancel`). The REST equivalents for monitoring are `GET https://opengen.dev/v1/generations/{id}/status`, `GET https://opengen.dev/v1/generations/{id}/events` (SSE), and `GET https://opengen.dev/v1/generations/{id}`.

When `deliveryStatus` is `available` or `partial`, `job_get` surfaces the private result card in hosts that support MCP Apps, and **always also** give the user a clickable **Open image**, **Open video**, or **Download** link for each current returned output URL directly in the authorized chat alongside any preview card, together with the job ID and each output's returned `expiresAt` when available (so the file remains reachable and refreshable even if a host hides or fails to render the card). Show only usable outputs and say when delivery is partial. Keep the job ID so a later `job_get` can refresh expired links while the private files are retained. Keep signed links in the authorized conversation.

If the host runs out of time, report the last known status and job ID and continue with read-only recovery when possible. Use the exact safe command in `recovery.resume.command` (or `error.resume.command` on failure), with its returned args/environment. A timeout, lost connection, or unknown acceptance never authorizes another paid submission. If no job ID arrived, call MCP `job_get` with `{idempotencyKey: SAVED_KEY}`, or `opengen job recover --idempotency-key SAVED_KEY` with the same gateway/profile. Reconcile through the operator if acceptance stays unknown. Preserve the original request, key and receipts.

Generation, delivery and billing are separate. Report a failed or expired delivery even when generation succeeded, and show delivered media without waiting for settlement. Cancellation does not imply refund. An expiring link is temporary access to an existing file. No or unknown C2PA evidence establishes no authenticity claim.

## Private feedback and missing routes

When the user requests feedback or a catalog addition, prepare a short sanitized report linked to relevant public model/route IDs and owned job ID. Preview the content and submit only when the user has authorized that report. Do not automatically send prompts, credentials, media, conversations or logs. OpenGen feedback is private to the workspace/operator; it is not a public ranking or third-party message. Feedback submission requires a separately scoped workspace key with `feedback:write`; the current OAuth `read`/`generate` grant does not include that permission.

The Public Developer OpenAPI specification is at `https://opengen.dev/openapi.json` (24 endpoints across 6 tags; interactive reference at `https://opengen.dev/docs/api`), and MCP exposes 15 focused typed tools on `https://opengen.dev/mcp` — the 9 read-only tools also exposed on `https://opengen.dev/mcp/readonly` (`find_models`, `get_model`, `estimate_cost`, `search_docs`, `balance`, `analytics`, `job_get`, `jobs_list`, `assets_list`, with zero-auth public discovery for `find_models`, `get_model`, `estimate_cost`, `search_docs`) plus 6 write/cleanup tools (`generate`, `job_cancel`, `purge_job_outputs`, `upload_asset`, `upload_attachment`, `delete_asset`) — with no unrestricted URL proxy. See `https://opengen.dev/docs`, `https://opengen.dev/docs/mcp`, `https://opengen.dev/docs/webhooks`, `https://opengen.dev/about`, and `https://opengen.dev/contact` for full documentation and support contacts. The future public OpenAI plugin has a separate narrower profile and review process.
