# API Reference

## API keys <a href="#xt-api-keys" id="xt-api-keys"></a>

Traces authenticates your API requests using your account’s API keys.  Making an API request that doesn't include your key, includes incorrect or outdated key returns an error. If you don’t have a valid API Key contact your Traces Account Manager.

### Test and Prod Keys <a href="#xn-test-and-prod-keys" id="xn-test-and-prod-keys"></a>

There are separate keys for testing and production workloads. All data submitted with a Test API key is removed automatically within 5 days and can not be restored. Auto Training Pipeline is not initiated with Test API calls. Use test API keys during the development and Prod API keys from production workloads.

### Keeping your API keys safe  <a href="#jx-keeping-your-api-keys-safe" id="jx-keeping-your-api-keys-safe"></a>

Your API key can be used to make any API call on behalf of your account.&#x20;

* Keep your API key as secure as any other password.&#x20;
* Keep your API key out of your version control system.&#x20;
* Share your API key only with those who need it.
* Use secret management services and password managers

Should you think your API key has been compromised, contact your Traces Account Manager immediately.

## HTTP response codes <a href="#un-http-response-codes" id="un-http-response-codes"></a>

Traces uses conventional HTTP response codes to indicate the success or failure of an API request.

&#x20;Codes in the 2xx range indicate success.&#x20;

Codes in the 4xx range indicate an error that failed given the information provided.&#x20;

Codes in the 5xx range indicate an error with the computation cluster.

| HTTP Code          | Status            | Explanation                                                                                      |
| ------------------ | ----------------- | ------------------------------------------------------------------------------------------------ |
| 200                | OK                | Everything worked as expected                                                                    |
| 400                | Bad Request       | The request was unacceptable, often due to missing a required parameter.                         |
| 401                | Unauthorized      | The parameters were valid but the request failed.                                                |
| 402                | Request Failed    | The API key doesn't have permission to perform the request.                                      |
| 403                | Forbidden         | The API key doesn't have permission to perform the request.                                      |
| 404                | Not Found         | The requested resource doesn't exist.                                                            |
| 429                | Too Many Requests | Too many requests hit the API too quickly. We recommend an exponential backoff of your requests. |
| 500, 502, 503, 504 | Server Errors     | Cluster encountered an unexpected condition that prevented it from fulfilling the request        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.traces.cloud/api-reference.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
