> For the complete documentation index, see [llms.txt](https://docs.yottalabs.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yottalabs.ai/products/serverless/accessing-serverless-tasks.md).

# Accessing Serverless Tasks

{% hint style="info" %}
Only tasks in the **Running** state can be accessed.
{% endhint %}

* Click the **Running** card to open the detailed page and find the endpoint URL.

<figure><img src="https://4009603828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ezFC70sdvT4ACdioCrw%2Fuploads%2Faj4wT2nh2xAQxsxhJZUf%2Fimage.png?alt=media&amp;token=ab0a2afd-2d10-4727-bca6-9d8969e2b87b" alt="" width="563"><figcaption></figcaption></figure>

<figure><img src="https://4009603828-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2ezFC70sdvT4ACdioCrw%2Fuploads%2FWeRkeIe8JmTiQl2rRCjr%2Fimage.png?alt=media&amp;token=941e3e2d-316c-4d70-ac56-92395d317ba8" alt="" width="563"><figcaption></figcaption></figure>

Example: Access via `curl`

{% hint style="warning" %}
Each request must include the header: `Authorization: Bearer <YOUR_API_KEY>`\
API keys can be found in **Settings → Access Keys**.

See more details in [API keys doc](https://docs.yottalabs.ai/api-and-sdk/api-keys)
{% endhint %}

```bash
curl --location 'https://2wmczkcst63e.yottadeos.com/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--data '{
  "temperature": 0.5,
  "top_p": 0.9,
  "max_tokens": 256,
  "frequency_penalty": 0.3,
  "presence_penalty": 0.2,
  "repetition_penalty": 1.2,
  "model": "meta-llama/Llama-3.2-3B-Instruct",
  "messages": [
    {
      "role": "user",
      "content": "Explain what is AI infrastructure."
    }
  ],
  "stream": false
}'
```

{% hint style="info" %}
The base URL is unique to your task (e.g. `https://2t5y1srid9mo.yottadeos.com`). Replace the `localhost` in the URL of your local deployment to get the full URL (e.g. in the above example, it would be `https://2t5y1srid9mo.yottadeos.com/v1/chat/completions`) of your service managed by the serverless task.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.yottalabs.ai/products/serverless/accessing-serverless-tasks.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
