Platform

Get started

Authentication

The SDK and REST API authenticate with a Picsart API key sent as a bearer token. The CLI signs in through your browser instead — no key to manage.

Get an API key#

Create a key on the console's API keys page — the key is shown once, when you create it. Then load it from an environment variable in your app.

Keep keys secret

Never commit an API key or ship it in client-side code. Load it from an environment variable or a secrets manager.

Authenticate a request#

SDK — pass apiKey and the SDK builds an authenticated fetch that sends Authorization: Bearer <key> on every request.

REST — send your API key as a bearer token. See the REST API for endpoints and request/response shapes.

CLI — the gen-ai CLI doesn't use an API key. It signs in through your browser with an OAuth flow and stores a token locally. Run it once per machine.

import { createClient } from '@picsart/ai-sdk';

const ai = createClient({
  apiKey: process.env.PICSART_API_KEY, // sent as: Authorization: Bearer <key>
  apiUrl: 'https://api.picsart.com',
});

Next steps#