Warnings and Errors
Breakdown of warnings and errors
The Task API may return various warnings and errors during operation. This page documents the possible error types you might encounter when using the API.
Errors
Errors result in a failure to process your request and are returned with appropriate HTTP status codes (4xx or 5xx).
Error | Description | Resolution |
---|---|---|
Invalid JSON Schema | The JSON schema provided in the task spec for input or output is invalid. | Review your schema against JSON Schema specifications and ensure it follows the required format. |
Task Spec + Input Too Long | The combined task specification and input exceeds 15,000 characters. | Reduce the size of your task spec or input data. Consider splitting into multiple tasks if necessary. |
Too-Complex Output Schema | The output schema exceeds allowed complexity in terms of nesting depth or number of fields. | Simplify your output schema by reducing nested levels to 3 or less. |
Warnings
Warnings indicate potential issues that don’t prevent the request from being processed but may affect results.
Warning | Description | Resolution |
---|---|---|
Input Fails Validation | The provided input does not conform to the input schema. | Verify your input against the schema requirements and make necessary adjustments. |
Task Spec + Input Over Size Limit | The combined task specification and input exceeds the character limit. | Consider optimizing your input or task spec for better performance. |
Too Many Output Fields | The number of requested output fields exceeds the recommended limit. | Consider reducing the number of output fields. |
Warning Handling
The Task API uses a warning system to provide guidance without blocking execution. Warnings are generated during validation and can be handled in two ways:
Basis Properties Warning
The following properties are provided by default through the task’s run basis and should not be defined in the output schema:
citations
confidence
evidence
reasoning
source
sources
source_urls
Including these in your output schema will trigger a warning, as it’s recommended to use FieldBasis in the run output instead.
API Errors
The Task API uses standard HTTP error code format to indicate the result of your request:
Status Code | Meaning | Description |
---|---|---|
402 | Payment issue | Run could not be completed due to no more credits. |
404 | Not Found | The requested resource (run ID or processor) was not found. |
408 | Request Timeout | The synchronous request timed out while waiting for completion. |
410 | Cancelled | The task run was cancelled. |
422 | Unprocessable Content | Validation failure in the request. |
429 | Too Many Requests | Rate limited or out of credits. |
500 | Internal Server Error | The task run failed due to an internal error. |