DOC-API-MODEL-schema-1fajlacjs0#overview
RpcError
Error payload containing an API-defined error code, a message and structured details. Interpret code using the ErrorCode enumeration published with this API; numeric equivalence with google.rpc.Status is not implied.
Meaning and usage
Section ID: DOC-API-MODEL-schema-1fajlacjs0#meaning
See the definition above.
Usage profiles
Section ID: DOC-API-MODEL-schema-1fajlacjs0#fields
| Usage | Fields and validation |
|---|---|
| In requests | View fields |
| In responses | View fields |
In requests
Section ID: DOC-API-MODEL-schema-1fajlacjs0#request
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
Section ID: DOC-API-MODEL-schema-1fajlacjs0#request-field-codecode | string (ERROR_CODE_CANCELLED, ERROR_CODE_UNKNOWN, ERROR_CODE_INVALID_ARGUMENT, ERROR_CODE_DEADLINE_EXCEEDED, ERROR_CODE_NOT_FOUND, ERROR_CODE_ALREADY_EXISTS, ERROR_CODE_PERMISSION_DENIED, ERROR_CODE_RESOURCE_EXHAUSTED, ERROR_CODE_FAILED_PRECONDITION, ERROR_CODE_ABORTED, ERROR_CODE_OUT_OF_RANGE, ERROR_CODE_UNIMPLEMENTED, ERROR_CODE_INTERNAL, ERROR_CODE_UNAVAILABLE, ERROR_CODE_DATA_LOSS, ERROR_CODE_UNAUTHENTICATED, ERROR_CODE_MODEL_INVALID, ERROR_CODE_MODEL_UNAVAILABLE, ERROR_CODE_MODERATION_FLAGGED, ERROR_CODE_GENERATION_FAILED, ERROR_CODE_TOOL_EXECUTION_FAILED, ERROR_CODE_UPSTREAM_PROVIDER, ERROR_CODE_VALIDATION_EXHAUSTED, ERROR_CODE_PAYMENT_REQUIRED) or integer (int32) | Optional; explicit presence | Machine-readable error code. Clients switch on this field. |
Section ID: DOC-API-MODEL-schema-1fajlacjs0#request-field-messagemessage | string | Optional | Human-readable error description. Intended for developers, not end users. Must not be parsed programmatically — use code and details instead. |
Section ID: DOC-API-MODEL-schema-1fajlacjs0#request-field-isterminalisTerminal | boolean | Optional | Whether this error is classified as terminal (non-retryable). A terminal error should not trigger automatic retries of the failed operation. A nonterminal error may reflect a transient condition that can resolve on retry. |
Section ID: DOC-API-MODEL-schema-1fajlacjs0#request-field-detailsdetails | ErrorDetails | Optional | Structured error details. At most one of each detail type. |
Values of code
Section ID: DOC-API-MODEL-schema-1fajlacjs0#request-values-code
API-defined categories describing why a request or operation failed. Use the published symbolic name and accompanying error details. These numeric assignments are not interchangeable with google.rpc.Code.
| Value | No. | Form | Meaning |
|---|---|---|---|
ERROR_CODE_CANCELLED | 0 | Canonical | See meaning below. |
ERROR_CODE_UNKNOWN | 1 | Canonical | See meaning below. |
ERROR_CODE_INVALID_ARGUMENT | 2 | Canonical | See meaning below. |
ERROR_CODE_DEADLINE_EXCEEDED | 3 | Canonical | See meaning below. |
ERROR_CODE_NOT_FOUND | 4 | Canonical | See meaning below. |
ERROR_CODE_ALREADY_EXISTS | 5 | Canonical | See meaning below. |
ERROR_CODE_PERMISSION_DENIED | 6 | Canonical | See meaning below. |
ERROR_CODE_RESOURCE_EXHAUSTED | 7 | Canonical | See meaning below. |
ERROR_CODE_FAILED_PRECONDITION | 8 | Canonical | See meaning below. |
ERROR_CODE_ABORTED | 9 | Canonical | See meaning below. |
ERROR_CODE_OUT_OF_RANGE | 10 | Canonical | See meaning below. |
ERROR_CODE_UNIMPLEMENTED | 11 | Canonical | See meaning below. |
ERROR_CODE_INTERNAL | 12 | Canonical | See meaning below. |
ERROR_CODE_UNAVAILABLE | 13 | Canonical | See meaning below. |
ERROR_CODE_DATA_LOSS | 14 | Canonical | See meaning below. |
ERROR_CODE_UNAUTHENTICATED | 15 | Canonical | See meaning below. |
ERROR_CODE_MODEL_INVALID | 16 | Canonical | See meaning below. |
ERROR_CODE_MODEL_UNAVAILABLE | 17 | Canonical | See meaning below. |
ERROR_CODE_MODERATION_FLAGGED | 18 | Canonical | See meaning below. |
ERROR_CODE_GENERATION_FAILED | 19 | Canonical | See meaning below. |
ERROR_CODE_TOOL_EXECUTION_FAILED | 20 | Canonical | See meaning below. |
ERROR_CODE_UPSTREAM_PROVIDER | 21 | Canonical | See meaning below. |
ERROR_CODE_VALIDATION_EXHAUSTED | 22 | Canonical | See meaning below. |
ERROR_CODE_PAYMENT_REQUIRED | 23 | Canonical | See meaning below. |
ERROR_CODE_CANCELLED
The caller cancelled the operation before it completed.
Canonical error categories.
499 — Cancelled by caller
ERROR_CODE_UNKNOWN
The operation failed without a more specific error classification.
500 — Unknown error
ERROR_CODE_INVALID_ARGUMENT
The request contains an invalid argument or field value.
400 — Bad input, invalid field values
ERROR_CODE_DEADLINE_EXCEEDED
The operation did not complete before its deadline.
504 — Operation timed out
ERROR_CODE_NOT_FOUND
The requested resource does not exist or could not be found.
404 — Resource does not exist
ERROR_CODE_ALREADY_EXISTS
The requested creation conflicts with a resource that already exists.
409 — Resource already exists
ERROR_CODE_PERMISSION_DENIED
The authenticated caller is not permitted to perform the operation.
403 — Caller lacks permission
ERROR_CODE_RESOURCE_EXHAUSTED
A quota, rate limit or other capacity limit prevented the operation.
429 — Rate limited or quota exceeded
ERROR_CODE_FAILED_PRECONDITION
The operation requires a system or resource state that is not currently satisfied.
400 — System not in required state
ERROR_CODE_ABORTED
The operation was aborted, for example by a concurrent modification conflict.
409 — Concurrent conflict, retry may succeed
ERROR_CODE_OUT_OF_RANGE
An argument is outside the range supported by this operation.
400 — Value outside valid range
ERROR_CODE_UNIMPLEMENTED
The requested operation is not implemented.
501 — Not implemented
ERROR_CODE_INTERNAL
An internal failure prevented the operation from completing.
500 — Internal error
ERROR_CODE_UNAVAILABLE
The service or a required dependency is temporarily unavailable.
503 — Service temporarily unavailable
ERROR_CODE_DATA_LOSS
The operation encountered unrecoverable loss or corruption of data.
500 — Unrecoverable data loss
ERROR_CODE_UNAUTHENTICATED
Authentication credentials are missing or invalid.
401 — Missing or invalid credentials
ERROR_CODE_MODEL_INVALID
The requested model identifier is absent from the model catalog.
Domain-specific error categories.
400 — Model ID not found in catalog
ERROR_CODE_MODEL_UNAVAILABLE
The model exists, but no provider is currently available to serve it.
503 — Model exists but all providers are down
ERROR_CODE_MODERATION_FLAGGED
Content moderation flagged the submitted content.
403 — Input flagged by content moderation
ERROR_CODE_GENERATION_FAILED
Model generation failed after its configured attempts.
500 — LLM generation failed after retries
ERROR_CODE_TOOL_EXECUTION_FAILED
Execution of a requested tool failed.
500 — MCP tool call failed
ERROR_CODE_UPSTREAM_PROVIDER
An upstream model provider returned an error.
503 — Upstream provider returned error
ERROR_CODE_VALIDATION_EXHAUSTED
Structured-output validation still failed after the configured attempts.
500 — Structured output validation failed after all retries
ERROR_CODE_PAYMENT_REQUIRED
The account lacks the credits required for the operation.
402 — Insufficient credits
In responses
Section ID: DOC-API-MODEL-schema-1fajlacjs0#response
API JSON uses JSON field names (camelCase).
| Field | Type | Presence | Meaning |
|---|---|---|---|
Section ID: DOC-API-MODEL-schema-1fajlacjs0#field-codeSection ID: DOC-API-MODEL-schema-1fajlacjs0#response-field-codecode | string (ERROR_CODE_CANCELLED, ERROR_CODE_UNKNOWN, ERROR_CODE_INVALID_ARGUMENT, ERROR_CODE_DEADLINE_EXCEEDED, ERROR_CODE_NOT_FOUND, ERROR_CODE_ALREADY_EXISTS, ERROR_CODE_PERMISSION_DENIED, ERROR_CODE_RESOURCE_EXHAUSTED, ERROR_CODE_FAILED_PRECONDITION, ERROR_CODE_ABORTED, ERROR_CODE_OUT_OF_RANGE, ERROR_CODE_UNIMPLEMENTED, ERROR_CODE_INTERNAL, ERROR_CODE_UNAVAILABLE, ERROR_CODE_DATA_LOSS, ERROR_CODE_UNAUTHENTICATED, ERROR_CODE_MODEL_INVALID, ERROR_CODE_MODEL_UNAVAILABLE, ERROR_CODE_MODERATION_FLAGGED, ERROR_CODE_GENERATION_FAILED, ERROR_CODE_TOOL_EXECUTION_FAILED, ERROR_CODE_UPSTREAM_PROVIDER, ERROR_CODE_VALIDATION_EXHAUSTED, ERROR_CODE_PAYMENT_REQUIRED) or integer (int32) | Optional; explicit presence | Machine-readable error code. Clients switch on this field. |
Section ID: DOC-API-MODEL-schema-1fajlacjs0#field-messageSection ID: DOC-API-MODEL-schema-1fajlacjs0#response-field-messagemessage | string | Optional | Human-readable error description. Intended for developers, not end users. Must not be parsed programmatically — use code and details instead. |
Section ID: DOC-API-MODEL-schema-1fajlacjs0#field-isterminalSection ID: DOC-API-MODEL-schema-1fajlacjs0#response-field-isterminalisTerminal | boolean | Optional | Whether this error is classified as terminal (non-retryable). A terminal error should not trigger automatic retries of the failed operation. A nonterminal error may reflect a transient condition that can resolve on retry. |
Section ID: DOC-API-MODEL-schema-1fajlacjs0#field-detailsSection ID: DOC-API-MODEL-schema-1fajlacjs0#response-field-detailsdetails | ErrorDetails | Optional | Structured error details. At most one of each detail type. |
Values of code
Section ID: DOC-API-MODEL-schema-1fajlacjs0#response-values-code
API-defined categories describing why a request or operation failed. Use the published symbolic name and accompanying error details. These numeric assignments are not interchangeable with google.rpc.Code.
| Value | No. | Form | Meaning |
|---|---|---|---|
ERROR_CODE_CANCELLED | 0 | Canonical | See meaning below. |
ERROR_CODE_UNKNOWN | 1 | Canonical | See meaning below. |
ERROR_CODE_INVALID_ARGUMENT | 2 | Canonical | See meaning below. |
ERROR_CODE_DEADLINE_EXCEEDED | 3 | Canonical | See meaning below. |
ERROR_CODE_NOT_FOUND | 4 | Canonical | See meaning below. |
ERROR_CODE_ALREADY_EXISTS | 5 | Canonical | See meaning below. |
ERROR_CODE_PERMISSION_DENIED | 6 | Canonical | See meaning below. |
ERROR_CODE_RESOURCE_EXHAUSTED | 7 | Canonical | See meaning below. |
ERROR_CODE_FAILED_PRECONDITION | 8 | Canonical | See meaning below. |
ERROR_CODE_ABORTED | 9 | Canonical | See meaning below. |
ERROR_CODE_OUT_OF_RANGE | 10 | Canonical | See meaning below. |
ERROR_CODE_UNIMPLEMENTED | 11 | Canonical | See meaning below. |
ERROR_CODE_INTERNAL | 12 | Canonical | See meaning below. |
ERROR_CODE_UNAVAILABLE | 13 | Canonical | See meaning below. |
ERROR_CODE_DATA_LOSS | 14 | Canonical | See meaning below. |
ERROR_CODE_UNAUTHENTICATED | 15 | Canonical | See meaning below. |
ERROR_CODE_MODEL_INVALID | 16 | Canonical | See meaning below. |
ERROR_CODE_MODEL_UNAVAILABLE | 17 | Canonical | See meaning below. |
ERROR_CODE_MODERATION_FLAGGED | 18 | Canonical | See meaning below. |
ERROR_CODE_GENERATION_FAILED | 19 | Canonical | See meaning below. |
ERROR_CODE_TOOL_EXECUTION_FAILED | 20 | Canonical | See meaning below. |
ERROR_CODE_UPSTREAM_PROVIDER | 21 | Canonical | See meaning below. |
ERROR_CODE_VALIDATION_EXHAUSTED | 22 | Canonical | See meaning below. |
ERROR_CODE_PAYMENT_REQUIRED | 23 | Canonical | See meaning below. |
ERROR_CODE_CANCELLED
The caller cancelled the operation before it completed.
Canonical error categories.
499 — Cancelled by caller
ERROR_CODE_UNKNOWN
The operation failed without a more specific error classification.
500 — Unknown error
ERROR_CODE_INVALID_ARGUMENT
The request contains an invalid argument or field value.
400 — Bad input, invalid field values
ERROR_CODE_DEADLINE_EXCEEDED
The operation did not complete before its deadline.
504 — Operation timed out
ERROR_CODE_NOT_FOUND
The requested resource does not exist or could not be found.
404 — Resource does not exist
ERROR_CODE_ALREADY_EXISTS
The requested creation conflicts with a resource that already exists.
409 — Resource already exists
ERROR_CODE_PERMISSION_DENIED
The authenticated caller is not permitted to perform the operation.
403 — Caller lacks permission
ERROR_CODE_RESOURCE_EXHAUSTED
A quota, rate limit or other capacity limit prevented the operation.
429 — Rate limited or quota exceeded
ERROR_CODE_FAILED_PRECONDITION
The operation requires a system or resource state that is not currently satisfied.
400 — System not in required state
ERROR_CODE_ABORTED
The operation was aborted, for example by a concurrent modification conflict.
409 — Concurrent conflict, retry may succeed
ERROR_CODE_OUT_OF_RANGE
An argument is outside the range supported by this operation.
400 — Value outside valid range
ERROR_CODE_UNIMPLEMENTED
The requested operation is not implemented.
501 — Not implemented
ERROR_CODE_INTERNAL
An internal failure prevented the operation from completing.
500 — Internal error
ERROR_CODE_UNAVAILABLE
The service or a required dependency is temporarily unavailable.
503 — Service temporarily unavailable
ERROR_CODE_DATA_LOSS
The operation encountered unrecoverable loss or corruption of data.
500 — Unrecoverable data loss
ERROR_CODE_UNAUTHENTICATED
Authentication credentials are missing or invalid.
401 — Missing or invalid credentials
ERROR_CODE_MODEL_INVALID
The requested model identifier is absent from the model catalog.
Domain-specific error categories.
400 — Model ID not found in catalog
ERROR_CODE_MODEL_UNAVAILABLE
The model exists, but no provider is currently available to serve it.
503 — Model exists but all providers are down
ERROR_CODE_MODERATION_FLAGGED
Content moderation flagged the submitted content.
403 — Input flagged by content moderation
ERROR_CODE_GENERATION_FAILED
Model generation failed after its configured attempts.
500 — LLM generation failed after retries
ERROR_CODE_TOOL_EXECUTION_FAILED
Execution of a requested tool failed.
500 — MCP tool call failed
ERROR_CODE_UPSTREAM_PROVIDER
An upstream model provider returned an error.
503 — Upstream provider returned error
ERROR_CODE_VALIDATION_EXHAUSTED
Structured-output validation still failed after the configured attempts.
500 — Structured output validation failed after all retries
ERROR_CODE_PAYMENT_REQUIRED
The account lacks the credits required for the operation.
402 — Insufficient credits
Where used
Section ID: DOC-API-MODEL-schema-1fajlacjs0#where-used
| Reference | Relationship |
|---|---|
| Send a message and wait for the result | POST /api/v1/llm/send-message-sync |
| Submit client-side tool results and wait for the next segment | POST /api/v1/llm/submit-client-tool-results-sync |
| Submit client-side tool execution results | POST /api/v1/llm/submit-client-tool-results |
Models containing this value
| Model | Relationship |
|---|---|
| ClientToolResult | Nested in model |
| LLMGenerationCompletedEvent | Nested in model |
| LLMGenerationCompletedEvent | Nested in model |
Download the public reference contract.
Document ID: DOC-API-MODEL-schema-1fajlacjs0