---
name: ai-logo-generator
description: Design and generate logos on the user's AI Logo Generator account (ailogogenerator.online). Use when the user wants a logo, icon or brand mark made, or wants a background removed from a logo they generated there.
homepage: https://ailogogenerator.online
---

# AI Logo Generator

You can generate logos on the user's own AI Logo Generator account. Each logo costs credits from the
same balance the user has on the website, and every result also appears in their dashboard.

Base URL: `https://ailogogenerator.online`. All calls below are plain HTTPS + JSON; use `curl` or any
HTTP client. Never invent endpoints that are not listed here.

## 1. Sign in (once per machine)

The user approves you in their browser. There is no API key.

1. Request a code:

   ```bash
   curl -s -X POST https://ailogogenerator.online/api/auth/device/code \
     -H 'Content-Type: application/json' -d '{"client_id":"agent-skill"}'
   ```

   Response: `device_code`, `user_code`, `verification_uri_complete`, `interval` (seconds), `expires_in`.

2. Open `verification_uri_complete` in the user's browser (or show it to them), and tell them the
   `user_code` so they can check it matches. They click **Approve** (logging in first if needed).

3. Poll every `interval` seconds until you get a token:

   ```bash
   curl -s -X POST https://ailogogenerator.online/api/auth/device/token \
     -H 'Content-Type: application/json' \
     -d '{"grant_type":"urn:ietf:params:oauth:grant-type:device_code","device_code":"<device_code>","client_id":"agent-skill"}'
   ```

   - `{"error":"authorization_pending"}`: keep polling.
   - `{"error":"slow_down"}`: wait longer between polls.
   - `access_denied` / `expired_token`: stop and tell the user; start again from step 1 if they want.
   - Success: `{"access_token":"...","token_type":"Bearer","expires_in":...}`.

4. Save the token to `~/.config/ailogogenerator/token` (create the folder, `chmod 600` the file) and
   reuse it. Send it on every call below as `Authorization: Bearer <token>`. Never print it in chat.

If a later call shows you are signed out (see "Check the balance"), delete the saved token and sign in again.

## 2. Check the balance

```bash
curl -s https://ailogogenerator.online/api/ai/logo/quota -H "Authorization: Bearer $TOKEN"
```

- `data.type == "authenticated"`: `data.balance` credits left, `data.costPerGeneration` per logo.
- `data.type == "anonymous"`: the token is no longer valid. Sign in again before generating.

If the balance is below the cost, tell the user and link them to https://ailogogenerator.online/pricing.

## 3. Generate a logo (4 credits)

Before generating, agree on the brief with the user: what the brand or subject is, the style, colors,
whether the brand name should appear as text, and transparent vs. solid background. Ask briefly; do
not quiz them.

```bash
curl -s -X POST https://ailogogenerator.online/api/ai/logo/generate \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{
    "params": {
      "subject": "a fox head",
      "vibe": "minimal geometric",
      "colors": ["#F97316", "#111827"],
      "text": "Nexus",
      "withBackground": false
    },
    "requestedFormat": "png"
  }'
```

- `params.subject` is required. `text` is the wordmark (`null` or omit for an icon only).
- `withBackground: false` gives a transparent PNG. `requestedFormat` is `png` or `jpg` (jpg is never transparent).
- Optional `referenceImageUrl`: a public `https://` image to use as the style reference.
- Success: `{"success":true,"data":{"taskId":"...","generationId":"..."}}`.

## 4. Wait for the result

Poll every 3 seconds, up to about 3 minutes:

```bash
curl -s -X POST https://ailogogenerator.online/api/ai/logo/query \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d '{"taskId":"<taskId>"}'
```

- `data.status` `pending` / `processing`: keep waiting.
- `completed`: `data.imageUrl` is the logo. Download it into the user's project if they want the file,
  and show them the URL.
- `failed`: the credits were refunded automatically. If `data.reason == "content_rejected"`, the image
  model's content check refused the request; suggest rewording. Otherwise offer to try again.

## 5. Remove the background (1 credit)

For a logo generated with a background:

```bash
curl -s -X POST https://ailogogenerator.online/api/ai/logo/remove-bg \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' -d '{"taskId":"<taskId of the logo>"}'
```

It returns a new `taskId`; poll `/api/ai/logo/query` with it exactly as in step 4.

## Errors

| `error` | Meaning | What to do |
|---|---|---|
| `insufficient_credits` | Not enough credits | Tell the user; link to /pricing |
| `turnstile_failed` / `anonymous_limit` | You are not signed in | Sign in again (step 1) |
| `content_rejected` (as `reason`) | Content check refused it | Suggest different wording |
| HTTP 5xx | Temporary failure | Wait a few seconds and retry once |

## Rules

- Each generation spends the user's credits. Generate one logo at a time unless the user asks for more,
  and say how many credits a request will cost before running several.
- Do not loop retries on failures; one retry at most, then tell the user.
- The user can see and disconnect signed-in AI tools at https://ailogogenerator.online/connect.
