Pricing

Error Catalog And Fixes

This section lists API error types, root causes, and quick mitigation steps. Every API error returns `error.code` and a `docs_url` pointing here.

Client Errors (4xx)

Issues with request parameters, body format, or input data.

Invalid JSON

invalid_json · HTTP 400

Problem: Request body is not valid JSON.

Solution: Check JSON syntax (quotes, commas, brackets) and ensure Content-Type is application/json.

Empty JSON object

invalid_json_body · HTTP 400

Problem: A JSON object with request fields is expected.

Solution: Send an object with model, prompt, and optional parameters.

Invalid body format

invalid_body · HTTP 400

Problem: API expects a JSON object but received another type.

Solution: Send body as a JSON object.

Unsupported model

invalid_model · HTTP 400

Problem: Selected model is not supported for this endpoint.

Solution: Use one of: nanobanano-2, nanobanano-2-2k, nanobanano-2-4k.

Invalid prompt

invalid_prompt · HTTP 400

Problem: Prompt is missing or empty.

Solution: Provide a non-empty string in the prompt field.

Invalid urls

invalid_urls · HTTP 400

Problem: urls must be an array of strings.

Solution: Use urls format like ["https://...", "data:image/png;base64,..."].

Invalid aspectRatio

invalid_aspect_ratio · HTTP 400

Problem: Provided aspectRatio is not supported.

Solution: Use one of: auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3, 5:4, 4:5, 21:9.

Invalid webHook

invalid_webhook · HTTP 400

Problem: webHook must be a string.

Solution: Provide callback URL as string or '-1' for polling mode.

Invalid shutProgress

invalid_shut_progress · HTTP 400

Problem: shutProgress must be boolean.

Solution: Use true or false.

Invalid task id

invalid_id · HTTP 400

Problem: id is missing or empty in result request.

Solution: Pass the id returned by generate endpoint.

Missing API key

missing_api_key · HTTP 401

Problem: Request was sent without API key credentials.

Solution: Send key via Authorization: Bearer <APISTOR_API_KEY> or x-api-key header.

Invalid API key

invalid_api_key · HTTP 401

Problem: Provided API key is not found, revoked, or malformed.

Solution: Verify key value or re-issue a new key in cabinet.

Insufficient balance

insufficient_balance · HTTP 402

Problem: Account balance is lower than request price.

Solution: Top up balance or switch to a cheaper model.

Platform Errors

Server configuration and internal platform setup issues.

Server is not configured

missing_grsai_api_key · HTTP 500

Problem: Grsai API key is not configured on server.

Solution: Set GRSAI_API_KEY environment variable and restart the app.

Provider Errors

Failures and limitations from Grsai/upstream providers.

Upstream authentication failed

upstream_auth_failed · HTTP 502

Problem: Provider rejected credentials.

Solution: Verify upstream API key validity and Grsai permissions.

Upstream rate limited

upstream_rate_limited · HTTP 429

Problem: Provider temporarily limits request rate.

Solution: Add retries with backoff and reduce burst traffic.

Upstream rejected request

upstream_invalid_request · HTTP 400

Problem: Provider considers request parameters invalid.

Solution: Check model, prompt, aspectRatio, and required fields.

Task not found upstream

upstream_task_not_found · HTTP 404

Problem: Provided task id does not exist upstream.

Solution: Check id and make sure it belongs to the right project/environment.

Input moderation

upstream_input_moderation · HTTP 422

Problem: Prompt/input blocked by provider moderation.

Solution: Soften prompt wording and remove restricted content.

Output moderation

upstream_output_moderation · HTTP 422

Problem: Generated output blocked by provider moderation.

Solution: Rephrase prompt and retry with safer context.

Upstream internal error

upstream_provider_error · HTTP 502

Problem: Provider failed internally while processing request.

Solution: Retry later and enable retry policy for critical workflows.

Upstream timeout

upstream_timeout · HTTP 504

Problem: Provider did not respond within server timeout.

Solution: Increase GRSAI_TIMEOUT_MS or switch to webhook/polling mode.

Upstream unavailable

upstream_unreachable · HTTP 502

Problem: Could not connect to provider.

Solution: Check network, DNS, and GRSAI_BASE_URL availability.

Unexpected upstream response

upstream_error_status · HTTP 502

Problem: Provider returned unexpected status or error format.

Solution: Check response details and upstream logs, then retry if needed.