Start with one order
Create a project for the workflow and store its key in n8n Credentials. Test the HTTP node with demo-text, then choose a configured model in the catalog. Send POST /v1/chat/completions with the project key, messages and the maximum output length.
Limit and trace spending
Pass X-Max-Cost-Rub to set the maximum charge and X-Client-Reference to identify the order. Reuse an Idempotency-Key for retries of one specific operation. A new workflow execution ID may represent a retry of the same order. Keep the operation key with the order record.
Reconcile a retry
Save the response's request ID. Look it up in request history to inspect execution, charge and released reserve. If you receive 422, adjust the task or authorize a larger cost cap before creating a new operation. n8n and Make setup.