To get started, create a developer account in the Crossmint Staging Console. Open that link, sign in, and accept the dialog to continue.
Crossmint offers two consoles: staging, for development and testing, and
production.
2
Get an API Key
Create a server-side API key with these scopes:
collection.create,
collection.update,
collection.read,
nfts.create,
nfts.read.This allows your API key to perform any kind of asset registration action.
Additional metadata can be added to the collection to help with discovery, such as a cover image. Check out the API reference for more information.To create the portfolio, run the script:
import OpenAI from 'openai'async function main() {const openai = new OpenAI({ apiKey: "<YOUR_OPENAI_API_KEY>"})const image = await openai.images.generate({ model: 'dall-e-2', prompt: 'A futuristic bridge connecting two digital worlds, with a sleek mint-colored pathway'});console.log(image.data[0].url) // the url to the newly created image}main();
The resulting image looks like this:
2
Register Image Design on Story
Copy
Ask AI
const response = await fetch("https://staging.crossmint.com/api/v1/ip/collections/{collectionId}/ipassets", { method: "POST", headers: { "X-API-KEY": "<YOUR_API_KEY>", "Content-Type": "application/json" }, body: JSON.stringify({ owner: 'email:[email protected]:story-testnet', nftMetadata: { name: 'My Image Design', description: 'An image designed to represent a futuristic bridge connecting two digital worlds, with a sleek mint-colored pathway', image: '<YOUR_IMAGE_URL>' }, ipAssetMetadata: { title: 'My Image Design', createdAt: '2025-02-11T11:13:00', ipType: 'image', creators: [ { name: 'John Doe', email: '[email protected]', crossmintUserLocator: 'email:[email protected]:story-testnet', contributionPercent: 100 }, ], attributes: [ { key: 'Model', value: 'dall-e-2' }, { key: 'Prompt', value: 'A futuristic bridge connecting two digital worlds, with a sleek mint-colored pathway' }, ] } })});const ipAsset = await response.json();console.log("IP Asset:", ipAsset);