# REST API

The base URL for endpoints described in this page of live trading API is `https://api.cube.exchange/os/v0`.

Definitions for requests and responses can be found in the [Trade OpenAPI Document](https://github.com/cubexch/gitbook/blob/main/generated/core/os_api_30.json).

Further specifics for field enums, reject codes, etc. can be found in the [Trade API Websocket Documentation](/cube-api/order-entry/websocket-api.md).

### Endpoints, authentication required

Endpoints in this section require [Authentication headers](/cube-api/exchange-info.md#authentication-headers). Note that only API keys with access-level `WRITE` are able to access *any* of these endpoints.

{% openapi src="/files/ZSsp2n40LTbzuWhuWKdg" path="/orders" method="get" %}
[os\_api\_30.json](https://398371474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlfNM0vNrk7VPr5UKauIS%2Fuploads%2Fgit-blob-115bbedbee1ed9d8b9c5c7bee0d4057fffbba4c6%2Fos_api_30.json?alt=media)
{% endopenapi %}

{% openapi src="/files/ZSsp2n40LTbzuWhuWKdg" path="/orders" method="delete" %}
[os\_api\_30.json](https://398371474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlfNM0vNrk7VPr5UKauIS%2Fuploads%2Fgit-blob-115bbedbee1ed9d8b9c5c7bee0d4057fffbba4c6%2Fos_api_30.json?alt=media)
{% endopenapi %}

{% openapi src="/files/ZSsp2n40LTbzuWhuWKdg" path="/order" method="post" %}
[os\_api\_30.json](https://398371474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlfNM0vNrk7VPr5UKauIS%2Fuploads%2Fgit-blob-115bbedbee1ed9d8b9c5c7bee0d4057fffbba4c6%2Fos_api_30.json?alt=media)
{% endopenapi %}

{% openapi src="/files/ZSsp2n40LTbzuWhuWKdg" path="/order" method="delete" %}
[os\_api\_30.json](https://398371474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlfNM0vNrk7VPr5UKauIS%2Fuploads%2Fgit-blob-115bbedbee1ed9d8b9c5c7bee0d4057fffbba4c6%2Fos_api_30.json?alt=media)
{% endopenapi %}

{% openapi src="/files/ZSsp2n40LTbzuWhuWKdg" path="/order" method="patch" %}
[os\_api\_30.json](https://398371474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlfNM0vNrk7VPr5UKauIS%2Fuploads%2Fgit-blob-115bbedbee1ed9d8b9c5c7bee0d4057fffbba4c6%2Fos_api_30.json?alt=media)
{% endopenapi %}

{% openapi src="/files/ZSsp2n40LTbzuWhuWKdg" path="/positions" method="get" %}
[os\_api\_30.json](https://398371474-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlfNM0vNrk7VPr5UKauIS%2Fuploads%2Fgit-blob-115bbedbee1ed9d8b9c5c7bee0d4057fffbba4c6%2Fos_api_30.json?alt=media)
{% endopenapi %}


---

# 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://cubexch.gitbook.io/cube-api/order-entry/rest-api.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.
