Use NewYouGo in Claude Code and Codex
Create an API key, paste one command, and your AI coding tool can generate images, videos and music with your NewYouGo credits.
NewYouGo runs a remote MCP server at https://newyougo.com/api/mcp. Once Claude Code, Codex, Cursor or a similar AI tool is connected, you can simply ask it to "generate an image of …". The AI picks a model, tells you the price, submits after you agree, waits for the result and downloads the file to your computer.
It spends credits from your own account, at exactly the same prices as generating on the website.
Before you start
- A NewYouGo account.
- Purchased credits in that account. API generations can only spend purchased credits; gifted credits are for the website only. Flux Schnell is the exception and uses the free 20-per-day allowance.
Step 1: Create an API key
- Sign in and open Settings › API keys, then click "Create creation API key".
- Give it a name, such as "My Claude Code".
- "Allowed models" defaults to all models, including ones added later. Untick it to choose specific models.
- Set the credit limit per job, the total credit budget and the expiry. The AI can never spend more than the per-job limit on one generation, and the key can never spend more than its budget in total.
- Click Create. The full key (starting with
nyg_) is shown only once, so copy it now.
The key can spend your credits. Don't share it, don't commit it to a repository and don't paste it into public chats. If it leaks, click "Revoke" on the same page and it stops working immediately.
Step 2: Connect your AI tool
After you create a key, the page shows these commands with your key already filled in. Below, replace nyg_your_key with your full key.
Claude Code
Run once in your terminal:
claude mcp add --scope user --transport http newyougo https://newyougo.com/api/mcp --header "Authorization: Bearer nyg_your_key"Run claude mcp list; newyougo ... ✔ Connected means it worked.
Codex
Put the key in an environment variable (add it to ~/.zshrc or ~/.bashrc, then open a new terminal):
export NEWYOUGO_API_KEY=nyg_your_keyThen add the server:
codex mcp add newyougo --url https://newyougo.com/api/mcp --bearer-token-env-var NEWYOUGO_API_KEYCursor and other remote-MCP clients
Add this to the tool's MCP configuration (for Cursor, ~/.cursor/mcp.json):
{
"mcpServers": {
"newyougo": {
"url": "https://newyougo.com/api/mcp",
"headers": { "Authorization": "Bearer nyg_your_key" }
}
}
}Step 3: Just ask
For example:
- "Use NewYouGo to generate an avocado illustration and save it here."
- "Use NewYouGo's GPT Image 2 to give ./photo.png a soft-light look."
- "Make a 5-second video with NewYouGo's Kling 3.0: the camera drifts through an avocado orchard. Tell me the credit cost first."
- "How many NewYouGo credits do I have left?"
The AI quotes the price before spending anything. It only submits after you agree, and it sends the limit you approved, so a higher price is refused.
What the AI can do
| Tool | Purpose |
|---|---|
list_models / get_model | Available models, operations and parameters |
get_balance | Purchased credits available, and how much this key has used |
create_upload_url | A 10-minute upload link for a reference image, video or audio file on your computer |
estimate_cost | Price a generation without spending credits |
generate | Submit a generation and charge the quoted credits |
get_job / list_jobs | Progress and results |
get_asset | A download link for a file (valid 5 minutes; ask again for a fresh one) |
Results are kept for 30 days and uploaded references for 7 days, up to 500 MB per account.
How credits are charged
- Prices are the same as on the website and depend on model, resolution and duration; see Pricing. FLUX 3 Max is priced from a live provider quote.
- Credits are reserved when you submit and refunded automatically if the generation fails.
- Retrying the same request is never charged twice.
Troubleshooting
| Message | Meaning and fix |
|---|---|
INVALID_API_KEY | The key is wrong, revoked or expired. Create a new one and update your configuration. |
INSUFFICIENT_CREDITS | Not enough purchased credits. Buy credits on Pricing. |
MAX_CREDITS_EXCEEDED | The price is above the limit you approved. Check the quote and let the AI retry with a new limit. |
KEY_BUDGET_EXCEEDED | This key's total budget is used up. Create a new key or use one with a larger budget. |
MODEL_SCOPE_DENIED | This key doesn't allow that model. |
RATE_LIMITED | Each key allows 120 requests per minute. Wait a minute. |
CONTENT_POLICY_VIOLATION | The prompt was rejected by content moderation. |
Revoking a key
In Settings › API keys, click "Revoke" next to the key. Every tool using it stops working immediately, and jobs that were queued but not yet submitted are not run.