Failures and refunds
Base URL https://arteza.ai/api/v1
OpenAPI 3.1 specification, for SDK generators and agents: /api/v1/openapi.json
Official SDKs for TypeScript and Python, a command line and agent skills: SDKs and CLI
You pay only for results. If the provider fails or refuses a request, the generation ends as failed and the full charge goes back to the balance it came from, credits or USD, automatically. You can cancel a queued generation with POST /v1/generations/{id}/cancel and get the same refund. The billing object of every generation shows whether it was refunded.
A failed generation carries error.code, error.retryable and error.message. Branch on the code: content_policy_violation (change the prompt or image), invalid_input (change the settings), timed_out and provider_error (safe to send again), insufficient_funds (top up). The message is English prose and may change.
Every generation that ends without a result is refunded, including one that stalls at the provider: a background check collects or settles any job that has run too long, so a charge is never left hanging. When error.retryable is true, send the request again with a new Idempotency-Key, because a key that was already used returns the original response instead of starting a new job. Webhooks report each outcome as generation.completed, generation.failed or generation.canceled, and the official SDKs raise a GenerationFailedError that carries the same code.