Create a key and fund your wallet
- Create a key in the developer console.
- Add funds to your API wallet.
- Set the credential in a terminal dedicated to v3. If your current shell runs
a legacy integration using
HEDRA_API_KEY, open a separate terminal first:
Check the cost
This example usesgpt-image-2. You can estimate the charge before submitting;
an estimate does not create a job.
Submit, wait, and download
Choose a language. Each example prints a job ID, waits for a terminal state, and downloads the first completed output tooutput.png in your current directory.
Running it submits a billable job and replaces that local file if it exists.
A local timeout stops waiting; it does not cancel the job.
- Python
- TypeScript
- cURL
job_... ID, followed by Saved output.png.
If a job fails or times out, use that ID to inspect it before submitting again.
See Errors and retries.
Next steps
Choose a model
Compare modalities and inspect model-specific schemas.
Send media inputs
Upload files and reuse generated assets.
Receive webhooks
Handle completion without polling.
Call language models
Use the OpenAI or Anthropic SDK with supported v3 routes.
Use Hedra from an AI client
To use Hedra from Claude, Cursor, Codex or ChatGPT, add the Hedra MCP server,https://mcp.hedra.com, to the client instead of calling the API. The client
signs you in with your Hedra account, and you need no API key:
Add to Claude
Opens Claude’s connector dialog with Hedra filled in.
Add to Cursor
Installs the Hedra MCP server in Cursor.
Codex, ChatGPT, Claude Code
Setup steps for every client.