Error Response Format
Every error response from the Nomiq API — regardless of status code — returns a JSON object with a top-levelerror key containing three fields:
HTTP Status Code Reference
The Nomiq API uses standard HTTP status codes. Codes in the2xx range indicate success. Codes in the 4xx range indicate a problem with your request that you must fix before retrying. Codes in the 5xx range indicate a transient problem on Nomiq’s infrastructure that you can safely retry.
Retry Strategy
Not all errors should be retried — only429 and 5xx responses are candidates for automatic retry. Retrying 400, 401, 403, or 404 errors will never succeed because they indicate a fundamental problem with your request or credentials, and repeated retries only waste your quota.
For 429 and 500 errors, use exponential backoff: wait one second before the first retry, two seconds before the second, four before the third, and so on, up to a maximum of five retries. Add a small random jitter (50–200ms) to each wait interval to prevent multiple clients from all retrying at the exact same moment.
Common Error Scenarios
Every request returns 401, but my API key looks correct.
Every request returns 401, but my API key looks correct.
The most frequent cause is a whitespace or formatting issue in the
Authorization header. The correct format is exactly Authorization: Bearer sk_live_xxxx — with a single space between Bearer and the key, and no trailing whitespace. Log the raw header string immediately before it is sent and verify it character by character. Also check that your environment variable is resolving to the full key value and not an empty string or the literal text $NOMIQ_API_KEY.A second common cause is environment mismatch: sending a Test key (sk_test_...) to api.nomiq.com or a Live key (sk_live_...) to sandbox.nomiq.com. Each key type is only valid on its matching base URL.Generation requests return 422 with 'prompt_validation_failure'.
Generation requests return 422 with 'prompt_validation_failure'.
This error fires when your brand generation prompt fails semantic validation before it reaches the AI engine. Common triggers include: prompts shorter than 10 characters, prompts that exceed 2,000 characters, or prompts that contain disallowed content categories. Check the
message field for the specific rule violation. If your application accepts freeform user input, add client-side validation before submitting to the API — for example, enforce a minimum length and strip any content that violates the policy listed in the Generation API reference.I'm getting 404 on a project_id that I just created.
I'm getting 404 on a project_id that I just created.
A
404 on a recently created project almost always means an environment mismatch. Projects created via the sandbox (sandbox.nomiq.com/v1) are isolated from the production environment (api.nomiq.com/v1). If you created the project with a Test key and are now querying it with a Live key (or vice versa), the project will appear not to exist. Ensure your key type and base URL are consistent across your entire request sequence.Sporadic 500 errors appear on generation requests during peak hours.
Sporadic 500 errors appear on generation requests during peak hours.
Transient
500 errors on generation endpoints during high-traffic windows typically indicate brief GPU queue pressure on Nomiq’s infrastructure. These errors self-resolve within seconds. Implement idempotent retries: include an Idempotency-Key header on every generation POST, then retry with the same key after a two-second delay. If Nomiq processed the original request before the error, the retry will return the original result without triggering a second generation. Monitor status.nomiq.com to distinguish transient spikes from sustained incidents.Next Steps
Rate Limits
Review per-plan rate limit thresholds, response headers, and how to implement exponential backoff correctly.
Authentication
Resolve authentication errors by reviewing how to generate, store, and pass API keys correctly.