Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Apply Ideogram security best practices for API key management and access control. Use when securing API keys, implementing key rotation, or auditing Ideogram security configuration. Trigger with phrases like "ideogram security", "ideogram secrets", "secure ideogram", "ideogram API key security", "ideogram key rotation".
.claude/skills/jeremylongshore-ideogram-security-basics/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 8% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 74% | 0% |
| case-23 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 87% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 5% | 0% |
Secure your Ideogram API integration. Ideogram uses a single Api-Key header for authentication -- there are no OAuth scopes, roles, or fine-grained permissions. Security focuses on key management, environment isolation, prompt sanitization, and preventing key exposure.
.gitignore configured for secretsbash# .env (NEVER commit) IDEOGRAM_API_KEY=your-key-here # .gitignore -- add these lines .env .env.local .env.*.local *.key
typescript// Validate key exists at startup -- fail fast function requireApiKey(): string { const key = process.env.IDEOGRAM_API_KEY; if (!key || key.length < 10) { throw new Error("IDEOGRAM_API_KEY not set or invalid. Check .env file."); } return key; }
Ideogram shows the full API key only once at creation. To rotate:
bashset -euo pipefail # 1. Create new key in Ideogram dashboard (Settings > API Beta > Create API key) # 2. Store new key immediately -- it won't be shown again # 3. Update your environment export IDEOGRAM_API_KEY="new-key-value" # 4. Verify new key works curl -s -o /dev/null -w "%{http_code}" \ -X POST https://api.ideogram.ai/generate \ -H "Api-Key: $IDEOGRAM_API_KEY" \ -H "Content-Type: application/json" \ -d '{"image_request":{"prompt":"rotation test","model":"V_2_TURBO","magic_prompt_option":"OFF"}}' # 5. Update deployment secrets # Vercel: vercel env rm IDEOGRAM_API_KEY production && vercel env add IDEOGRAM_API_KEY production # GitHub Actions: gh secret set IDEOGRAM_API_KEY # AWS: aws secretsmanager update-secret --secret-id ideogram-api-key --secret-string "$IDEOGRAM_API_KEY" # 6. Delete old key from Ideogram dashboard after confirming zero traffic
typescript// Proxy pattern -- never expose API key to browser // api/ideogram-proxy.ts (server-side only) export async function POST(req: Request) { const { prompt, style } = await req.json(); // Validate and sanitize before forwarding if (!prompt || prompt.length > 10000) { return Response.json({ error: "Invalid prompt" }, { status: 400 }); } const response = await fetch("https://api.ideogram.ai/generate", { method: "POST", headers: { "Api-Key": process.env.IDEOGRAM_API_KEY!, // Server-side only "Content-Type": "application/json", }, body: JSON.stringify({ image_request: { prompt, model: "V_2", style_type: style || "AUTO", magic_prompt_option: "AUTO", }, }), }); const result = await response.json(); // Return only the image data, never the API key or internal details return Response.json({ images: result.data?.map((d: any) => ({ url: d.url, seed: d.seed, resolution: d.resolution, })), }); }
bash#!/bin/bash # .git/hooks/pre-commit -- prevent accidental key commits set -euo pipefail # Check for potential Ideogram API keys in staged files if git diff --cached --diff-filter=d | grep -qiE '(Api-Key|IDEOGRAM_API_KEY)\s*[:=]\s*["\x27]?[a-zA-Z0-9_-]{20,}'; then echo "ERROR: Potential Ideogram API key detected in staged changes." echo "Remove the key and use environment variables instead." exit 1 fi
typescript// Prevent prompt injection and abuse function sanitizePrompt(prompt: string): { safe: boolean; cleaned: string; reason?: string } { // Length check (Ideogram max: 10,000 chars) if (prompt.length > 10000) { return { safe: false, cleaned: prompt.slice(0, 10000), reason: "Prompt too long" }; } // Remove potential PII patterns const cleaned = prompt .replace(/\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/gi, "[email]") .replace(/\b\d{3}[-.]?\d{3}[-.]?\d{4}\b/g, "[phone]") .replace(/\b\d{3}-\d{2}-\d{4}\b/g, "[ssn]"); return { safe: true, cleaned }; }
.env files in .gitignore| Security Issue | Detection | Mitigation | |----------------|-----------|------------| | Key exposed in git | git log -p --all -S "Api-Key" | Rotate key immediately | | Key in client-side JS | Browser DevTools audit | Move to server-side proxy | | Unlimited billing | No top-up cap set | Set conservative auto top-up limits | | Prompt contains PII | Sanitization check | Strip before API call |
For production deployment, see ideogram-prod-checklist.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 24,073 | 22,405 | -7% | 1 | 1 | 0% | 4,655 | 5,030 | +8% | 0 | 0 | — |
case-02 | fail→pass | 16,446 | 24,817 | +51% | 1 | 1 | 0% | 3,038 | 5,284 | +74% | 0 | 0 | — |
case-23 | fail→pass | 14,662 | 11,681 | -20% | 1 | 1 | 0% | 2,454 | 2,722 | +11% | 0 | 0 | — |
case-03 | fail→pass | 16,401 | 27,841 | +70% | 1 | 1 | 0% | 1,910 | 3,572 | +87% | 0 | 0 | — |
case-04 | pass→pass | 31,637 | 20,637 | -35% | 1 | 1 | 0% | 3,489 | 5,635 | +62% | 0 | 0 | — |
case-05 | pass→pass | 24,892 | 20,389 | -18% | 1 | 1 | 0% | 2,763 | 4,348 | +57% | 0 | 0 | — |
case-06 | pass→fail | 14,941 | 12,432 | -17% | 1 | 1 | 0% | 2,754 | 3,976 | +44% | 0 | 0 | — |
case-07 | fail→pass | 18,362 | 8,249 | -55% | 1 | 1 | 0% | 2,095 | 2,190 | +5% | 0 | 0 | — |
case-08 | pass→pass | 24,002 | 22,155 | -8% | 1 | 1 | 0% | 3,466 | 4,134 | +19% | 0 | 0 | — |
case-09 | fail→pass | 12,230 | 12,640 | +3% | 1 | 1 | 0% | 2,067 | 2,995 | +45% | 0 | 0 | — |
case-10 | pass→pass | 13,968 | 11,592 | -17% | 1 | 1 | 0% | 2,398 | 2,737 | +14% | 0 | 0 | — |
case-11 | fail→pass | 20,413 | 9,820 | -52% | 1 | 1 | 0% | 1,409 | 2,162 | +53% | 0 | 0 | — |
case-12 | fail→fail | 12,141 | 36,474 | +200% | 1 | 1 | 0% | 2,245 | 2,573 | +15% | 0 | 0 | — |
case-13 | fail→pass | 23,151 | 17,027 | -26% | 1 | 1 | 0% | 3,298 | 3,824 | +16% | 0 | 0 | — |
case-14 | fail→pass | 15,959 | 9,780 | -39% | 1 | 1 | 0% | 2,109 | 2,552 | +21% | 0 | 0 | — |
case-15 | pass→pass | 18,324 | 13,194 | -28% | 1 | 1 | 0% | 1,858 | 3,225 | +74% | 0 | 0 | — |
case-16 | pass→pass | 6,061 | 8,555 | +41% | 1 | 1 | 0% | 1,005 | 2,157 | +115% | 0 | 0 | — |
case-17 | pass→pass | 5,180 | 8,999 | +74% | 1 | 1 | 0% | 1,001 | 2,178 | +118% | 0 | 0 | — |
case-18 | pass→pass | 8,385 | 7,807 | -7% | 1 | 1 | 0% | 1,440 | 2,036 | +41% | 0 | 0 | — |
case-19 | pass→pass | 11,985 | 8,265 | -31% | 1 | 1 | 0% | 1,085 | 1,814 | +67% | 0 | 0 | — |
case-20 | fail→pass | 13,804 | 6,868 | -50% | 1 | 1 | 0% | 1,335 | 1,812 | +36% | 0 | 0 | — |
case-21 | pass→pass | 18,011 | 18,968 | +5% | 1 | 1 | 0% | 1,803 | 4,472 | +148% | 0 | 0 | — |
case-22 | pass→pass | 23,581 | 13,396 | -43% | 1 | 1 | 0% | 1,595 | 2,614 | +64% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 22 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +39 percentage points is the difference between those two pass rates over the 22 comparable cases. 1 case got worse with the skill loaded, and it is included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.