# API Specification of the Relay

## Resources

The JSON schema of the OpenAPI Specification of the Relay can be found at:

{% embed url="<https://dy.relay.crynux.ai/openapi.json>" %}

The rendered document of the specification can be accessed at:

{% embed url="<https://dy.relay.crynux.ai/static/api_docs.html>" %}

## API List

### Task Related APIs

{% openapi src="<https://dy.relay.crynux.ai/openapi.json>" path="/v1/inference\_tasks" method="post" %}
<https://dy.relay.crynux.ai/openapi.json>
{% endopenapi %}

{% openapi src="<https://dy.relay.crynux.ai/openapi.json>" path="/v1/inference\_tasks/{task\_id}" method="get" %}
<https://dy.relay.crynux.ai/openapi.json>
{% endopenapi %}

{% openapi src="<https://dy.relay.crynux.ai/openapi.json>" path="/v1/inference\_tasks/{task\_id}/results" method="post" %}
<https://dy.relay.crynux.ai/openapi.json>
{% endopenapi %}

{% openapi src="<https://dy.relay.crynux.ai/openapi.json>" path="/v1/inference\_tasks/{task\_id}/results/{image\_num}" method="get" %}
<https://dy.relay.crynux.ai/openapi.json>
{% endopenapi %}

### Network Stats Related APIs

{% openapi src="<https://dy.relay.crynux.ai/openapi.json>" path="/v1/network" method="get" %}
<https://dy.relay.crynux.ai/openapi.json>
{% endopenapi %}

{% openapi src="<https://dy.relay.crynux.ai/openapi.json>" path="/v1/network/nodes/data" method="get" %}
<https://dy.relay.crynux.ai/openapi.json>
{% endopenapi %}

{% openapi src="<https://dy.relay.crynux.ai/openapi.json>" path="/v1/network/nodes/number" method="get" %}
<https://dy.relay.crynux.ai/openapi.json>
{% endopenapi %}

{% openapi src="<https://dy.relay.crynux.ai/openapi.json>" path="/v1/network/tasks/number" method="get" %}
<https://dy.relay.crynux.ai/openapi.json>
{% endopenapi %}

### Other APIs

{% openapi src="<https://dy.relay.crynux.ai/openapi.json>" path="/v1/now" method="get" %}
<https://dy.relay.crynux.ai/openapi.json>
{% 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://docs.crynux.io/application-development/api-specification-of-the-relay.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.
