Skip to main content
The nomiq-python package is the official SDK for integrating Nomiq’s AI brand generation engine into Python applications. It provides a clean, synchronous client interface over the Nomiq REST API, handles bearer token authentication on every request, and includes a built-in HMAC verification helper for securing your webhook endpoints — everything you need to go from install to your first generated brand identity in minutes.

Requirements

Before installing the SDK, confirm your environment meets the minimum version requirement:
  • Python 3.9 or higher — the SDK uses type hints and language features introduced in Python 3.9.

1

Install the SDK

Install nomiq-python from PyPI using your preferred package manager.
Never hardcode your API key directly in your source files or commit it to version control. Always load secrets from environment variables or a secrets manager such as AWS Secrets Manager or HashiCorp Vault.
2

Initialize the Client

Import the nomiq module and instantiate a Client by passing your API key. The client is the single entry point for all SDK methods and authenticates every request automatically.
The Client attaches your key as a Bearer token on the Authorization header for every outbound request to https://api.nomiq.com/v1. For local development, use a .env file with a library such as python-dotenv to load NOMIQ_API_KEY into your environment before your script runs.
3

Create a Project

Projects are the top-level containers for all brand assets and generation history. You must create a project before you can dispatch a generation job.
A successful response returns a project object you can immediately use:
4

Generate a Brand

Call client.brands.generate() with your project_id and a detailed semantic prompt. Generation runs asynchronously — you receive a 202 Accepted response with a job object immediately, and the completed assets are delivered to your webhook URL when the AI Engine finishes.
The returned job object confirms the request is in the queue:
5

Handle the Webhook

Configure your webhook endpoint URL in Workspace Settings and listen for generation.success or generation.failed events. Nomiq signs every webhook request with an HMAC-SHA256 signature in the Nomiq-Signature header — you must verify this before processing any payload.The example below shows a complete Flask webhook handler using Python’s built-in hmac module for constant-time signature comparison.

Projects

The client.projects namespace exposes the full Projects API, letting you create and manage project containers programmatically.

Create a Project

Retrieve a Project

Fetch the current state of any existing project by its ID.

List Projects

Returns all projects in your workspace sorted newest-first. The response supports cursor-based pagination via limit and starting_after.

Delete a Project

Deleting a project is permanent and irreversible. All associated generated assets, history nodes, and memory data are immediately removed from the database. This action cannot be undone.

Brand Generation

Dispatch a brand generation job by providing a project_id and a rich semantic prompt. You can optionally pass a webhook_url to override the default delivery endpoint configured in your Workspace Settings on a per-request basis.
Generation jobs typically complete within 3–10 seconds depending on asset complexity. Do not poll the API for status — Nomiq will POST the completed assets to your webhook endpoint automatically.

Handling Webhooks

Nomiq delivers the completed brand assets via a POST request to your configured webhook URL. The full generation.success payload contains the SVG markup, primary color hex value, and font family:
The memory_id field identifies the Memory Node created for this generation. Store it alongside your job record — pass it back to client.brands.generate() as the memory_id parameter to refine this brand in a subsequent iteration rather than generating from scratch. Return a 200 OK response within 5 seconds of receiving the webhook. Offload any heavy work — database writes, file storage, downstream notifications — to an asynchronous task queue such as Celery or RQ. If Nomiq does not receive a 200 within the timeout window, it retries with exponential backoff.

Error Handling

The SDK raises structured exceptions when the API returns a non-2xx response. Wrap your calls in try/except and inspect the exception’s attributes to implement granular error handling.
The NomiqAPIError exception exposes the following attributes for structured handling:

Node.js SDK

Use the official Nomiq Node.js SDK to integrate brand generation into JavaScript and TypeScript applications.

API Reference

Explore the full REST API reference, including all endpoints, request parameters, and response schemas.