B2BB2B LLM

Partner API FAQ

Practical answers about account keys, usage, rotation, and callbacks.

Partner API FAQ

What is the difference between an account API key and a Model API key?

The account-level API key (mg_partner_...) manages Model API keys through https://p-api.model-gate.com/api/v1/partner/* and retrieves asynchronous results through https://p-api.model-gate.com/api/v1/requests/{request_public_id}.

A Model API key (mg_live_...) authenticates inference requests through https://api.model-gate.com.

Never send an account-level Partner API key to an inference endpoint or expose it in client-side applications.

Which counter enforces spend_limit?

The resettable usage counter enforces the limit. POST /api/v1/partner/keys/{key_public_id}/reset-usage clears the key counter. total_spent is lifetime accounting and never resets.

Does every Model API key have a separate account balance?

No. All Model API keys spend from the owning Model Gate account balance. Per-key and group limits restrict usage without splitting the account balance into child balances.

What happens when a Model API key is rotated?

The old secret stops working immediately. The rotation response contains the new plaintext secret once. Store it securely because Model Gate does not display the complete secret again.

How are callbacks configured?

Configure callback_url and rotate callback_secret in the Model Gate profile. Asynchronous completion results are sent when a callback URL exists. Optional low-key-limit, Key Group limit and low-account-balance events can be enabled separately; their thresholds are configured in Profile notifications.

Callback delivery is durable and independent of inference processing. Every event carries a stable event_id that remains unchanged across retries and must be used for consumer deduplication. Any HTTP 2xx response is successful. Delivery uses at most 6 attempts total, with retries after 5 seconds, 30 seconds, 2 minutes, 10 minutes and 1 hour; each attempt has a 15-second overall timeout. Transport errors, timeouts and non-2xx responses are retried, and after the sixth failed attempt the event is marked failed with no further automatic retry. See Callbacks for the event catalog, exact-decimal payloads, signatures, destination security and delivery details.

How long can an async result be retrieved?

An asynchronous result remains available for 24 hours through GET https://p-api.model-gate.com/api/v1/requests/{request_public_id}. After expiration, the stored request and response are deleted and the endpoint returns 404.

Do Partner mutations support safe retry?

Yes. Every Partner API POST, PATCH, and DELETE requires Idempotency-Key. Retry the same logical operation with the same key after a timeout; for 7 days Model Gate returns the original result without executing the mutation again. Reusing a key for a different request returns 409.

How long is detailed request history available?

Detailed Partner request history follows API_REQUESTS_HOT_RETENTION_DAYS (default 7 days) and reports that window in response metadata. Use cursor-paginated account balance transactions for longer-term financial reconciliation.