# AI NFT Generator

## AI NFT Generator

Generate images from text prompts and mint them as NFTs on-chain across 22+ blockchains. Choose from four generation models optimized for different speed and quality trade-offs.

### Key Facts

|                       |                                                  |
| --------------------- | ------------------------------------------------ |
| **Generate Endpoint** | `POST /nft/generate-image`                       |
| **Mint Endpoint**     | `POST /nft/mint`                                 |
| **Full NFT Endpoint** | `POST /nft/generate-nft`                         |
| **Enhance Prompt**    | `POST /nft/enhancePrompt`                        |
| **List Chains**       | `GET /nft/get-chains`                            |
| **Check Progress**    | `GET /nft/progress/{id}`                         |
| **Cost**              | 1 -- 14.25 credits (varies by model and upscale) |
| **SDK**               | `@chaingpt/nft`                                  |
| **Chains**            | 22+ supported for minting                        |

### Generation Models

| Model              | Style           | Speed     | Steps  | Best For                                                 |
| ------------------ | --------------- | --------- | ------ | -------------------------------------------------------- |
| **VeloGen**        | Fast generation | Very fast | 1--4   | Rapid prototyping, previews, high-volume generation      |
| **NebulaForge XL** | Highly detailed | Slower    | More   | Premium artwork, detailed illustrations, showcase pieces |
| **VisionaryForge** | General purpose | Medium    | Medium | Balanced quality and speed for most use cases            |
| **Dale3**          | DALL-E 3        | Medium    | N/A    | Photorealistic images, complex scene composition         |

### Credit Costs

Costs vary based on the model selected and whether upscaling is applied. The range is **1 credit** (VeloGen, no upscale) to **14.25 credits** (NebulaForge XL with maximum upscale). Check the reference/ docs for the full pricing matrix.

### Endpoints

| Method | Path                  | Description                                                 |
| ------ | --------------------- | ----------------------------------------------------------- |
| `POST` | `/nft/generate-image` | Generate an image from a text prompt (returns image URL)    |
| `POST` | `/nft/generate-nft`   | Generate image and prepare NFT metadata in one call         |
| `POST` | `/nft/mint`           | Mint a generated image as an NFT on a supported chain       |
| `POST` | `/nft/enhancePrompt`  | AI-enhance a rough prompt into a detailed generation prompt |
| `GET`  | `/nft/get-chains`     | List all supported chains for minting                       |
| `GET`  | `/nft/progress/{id}`  | Check the progress of an in-flight generation or mint       |

### Quick Start -- JavaScript

Install the SDK:

```bash
npm install @chaingpt/nft
```

#### Generate an Image

```javascript
import { Nft } from "@chaingpt/nft";

const client = new Nft({
  apiKey: process.env.CHAINGPT_API_KEY,
});

const image = await client.generateImage({
  prompt: "A cyberpunk city skyline with neon blockchain nodes floating above the buildings",
  model: "VisionaryForge",
});

console.log("Image URL:", image.data.imageUrl);
```

#### Generate + Mint Flow

```javascript
import { Nft } from "@chaingpt/nft";

const client = new Nft({
  apiKey: process.env.CHAINGPT_API_KEY,
});

// Step 1: Enhance the prompt
const enhanced = await client.enhancePrompt({
  prompt: "a dragon guarding a vault of crypto coins",
});
console.log("Enhanced prompt:", enhanced.data.enhancedPrompt);

// Step 2: Generate the image
const image = await client.generateImage({
  prompt: enhanced.data.enhancedPrompt,
  model: "NebulaForge XL",
});
console.log("Image URL:", image.data.imageUrl);

// Step 3: List available chains
const chains = await client.getChains();
console.log("Available chains:", chains.data);

// Step 4: Mint the NFT
const mintResult = await client.mint({
  imageUrl: image.data.imageUrl,
  name: "Dragon Vault Guardian",
  description: "A dragon guarding a vault of crypto coins",
  chain: "BSC",
  walletAddress: "0xYourWalletAddress",
});

console.log("Mint transaction:", mintResult.data.transactionHash);

// Step 5: Check progress if needed
const progress = await client.getProgress(mintResult.data.id);
console.log("Status:", progress.data.status);
```

### Tips

* Use `enhancePrompt` before generating -- it significantly improves output quality, especially with short or vague prompts.
* Start with **VeloGen** during development and switch to **NebulaForge XL** for production artwork.
* The `generate-nft` endpoint combines generation and metadata preparation into a single call, which is simpler for basic flows.
* Poll `progress/{id}` for long-running generations or mints rather than blocking.
* Pair with the Smart Contract Auditor if you are deploying custom minting contracts alongside the generated NFTs.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chaingpt.org/dev-docs-b2b-saas-api-and-sdk/chaingpt-claude-skill-and-plugin/products/ai-nft-generator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
