Errors detected while validating a request are returned in a format compatible with the OpenAI SDK:
{
"error": {
"type": "permission_error",
"code": "module_not_allowed",
"message": "The token does not grant access to the module ACADEMIC.",
"request_id": "6f1c2a9e-4b7d-4e0a-9c55-2d8e1f3b7a10"
}
}Fields of the error object:
typeis the error category:authentication_error(401),permission_error(403),not_found_error(404),invalid_request_error(400, 405, 413),rate_limit_error(429),api_error(5xx);codeis the machine-readable error code;messageis the description of the error in English;request_idis the request identifier to be stated when contacting the university.
9.1. API token authorization
Checks are performed in the order given in the table; the response is produced by the first failed check.
| HTTP | CODE | MEANING | RECOMMENDED ACTION |
|---|---|---|---|
| 429 | too_many_auth_failures | Requests from the IP address are temporarily rejected after 30 failed authorization attempts within 10 minutes. | Verify the token value and repeat the request after 15 minutes. |
| 503 | api_disabled | Acceptance of API requests is temporarily suspended. | Repeat the request later. |
| 401 | invalid_api_key | The token is missing, invalid or revoked. | Verify the authorization header; if the token has been revoked, request a new token. |
| 401 | token_expired | The token has expired. | Contact the university to have a new token issued. |
| 403 | token_blocked | The token has been blocked by the university administration. | Contact the university. |
| 403 | ip_not_allowed | The request was sent from an IP address that is not permitted for the token. | Send requests from a permitted address or request a change to the list of addresses. |
| 404 | not_found | The path does not belong to any module or the operation is not supported. | Verify the request path. |
| 403 | module_not_allowed | The module is not included in the token. | Contact the university to extend access. |
| 503 | module_disabled | The module is temporarily disabled. | Repeat the request later. |
| 405 | method_not_allowed | A data module accepts only requests made with the GET method. The response contains the Allow: GET header. | Use the GET method. |
| 429 | rate_limit_exceeded | The permitted number of requests per minute has been exceeded. | Repeat the request after the period specified in the Retry-After header. |
| 400 | invalid_path | The request path contains prohibited segments: . and .., or an encoded dot, slash or backslash. | Specify the path without dot segments and without encoded separators. |
| 413 | request_too_large | The size of the request body exceeds the permitted limit. | Reduce the request size to the limits stated in the “Limits and headers” section. |
| 400 | invalid_json | The body of a request to the ALEM module is not a valid JSON object. | Send the request body as a JSON object. |
| 400 | invalid_multipart | The body of an audio transcription request is not a valid multipart/form-data document. | Send the file and the parameters as multipart/form-data with the part boundary specified. |
| 400 | model_required | The request to the ALEM module does not specify a model. | Specify the model in the model field, selecting it from the GET /os/v1/alem/models response. |
| 404 | model_not_found | The model is not in the list of models. | Select a model from the GET /os/v1/alem/models response. |
| 403 | model_not_allowed | The model is not permitted by the token. | Use a permitted model or request extended access. |
| 502 | upstream_auth_error | An internal authorization failure occurred while accessing the information system or the Alem.Cloud platform. | Repeat the request later; if the error persists, report the request identifier to the university. |
| 502 | upstream_error | The information system or the Alem.Cloud platform did not respond or completed processing with an error. | Repeat the request later with an increasing interval. |
| 503 | alem_unavailable | The ALEM module is temporarily unavailable. | Repeat the request later. |
| 500 | internal_error | An internal error occurred while processing the request. | Repeat the request later; if the error persists, report the request identifier to the university. |
9.2. “Sign in with QAIRU” authorization
With a student access token, the following codes are used instead of invalid_api_key, token_expired, token_blocked, ip_not_allowed and module_not_allowed; the other codes apply unchanged.
| HTTP | CODE | MEANING | RECOMMENDED ACTION |
|---|---|---|---|
| 401 | invalid_token | The access token is invalid: its signature failed verification, it has expired, or it was issued to an unregistered application. | Refresh the access token with the refresh_token; if the refresh fails, ask the student to sign in again. |
| 401 | token_revoked | The student has revoked access for the application; tokens issued before the revocation are not accepted. | Ask the student to sign in again and confirm access. |
| 403 | app_disabled | The application has been disabled by the university administration. | Contact the university. |
| 403 | student_only | The access token was issued to an account that is not a student account. | Sign in with a student account. |
| 403 | scope_not_granted | The module scope has not been granted by the student, is not permitted for the application, or the module is disabled. | Request the module scope at sign-in or contact the university to extend the list of modules of the application. |
Errors that occur in the information system itself while processing a request to a data module, for example 404 for a non-existent record, are passed in the original format of the information system. Authorization server errors are listed in the “Sign in with QAIRU” section.