# How to use the API

### Preparation for work <a href="#before-you-start" id="before-you-start"></a>

To use the API, you need to get an access key id and secret key.

Static key authorization is required to access the HTTP API directly and is supported by the tools listed in the [Supported Tools](/tools/supported-tools.md) section .

For a list of supported Amazon S3 HTTP API methods, see the [API Reference](/http-api-compatible-with-amazon-s3/api-reference.md) .

### General view of the API request <a href="#common-request-form" id="common-request-form"></a>

```
{GET|HEAD|PUT|DELETE|MOVE} /<bucket>/<key> HTTP/1.1
Host: s3.coldstack.io
Content-Length: length
Date: date
Authorization: authorization string (AWS Signature Version 4)

Request_body
```

The bucket name can be specified as part of the hostname. In this case, the request will take the form:

```
{GET|HEAD|PUT|DELETE|MOVE} /<key>} HTTP/1.1
Host: <bucket>.s3.coldstack.io
...
```

The set of headers depends on the specific request and is described in the documentation for the corresponding request.

If you use the API directly (without SDK and applications), then you will have to generate the header yourself to sign the requests `Authorization`. For information on how to do this, see the [Authenticating Requests (AWS Signature Version 4)](https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html) section of the Amazon S3 documentation.

#### Request URL <a href="#request-url" id="request-url"></a>

The URL can take one of the following forms:

* `https://s3.coldstack.io/<bucket>/<key>?<parameters>`
* `https://<bucket>.s3.coldstack.io/<key>?<parameters>`


---

# 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.coldstack.io/http-api-compatible-with-amazon-s3/how-to-use-the-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.
