AlpineX LLM ServicesGuideReference

AI Agents

AlpineX AI Agents Documentation

OverviewCopied!

Alpinex AI provides access to various specialized agents through its API. These agents are tailored for specific functionalities and deliver high-quality responses within their respective domains. Each agent operates independently with predefined settings and configurations.

Base URLCopied!

All API requests are made to the following base URL:

https://api.alpinex.ai/v1/agent

AuthenticationCopied!

To use the API, you must create an API key in the Alpinex app. Pass this key in the header of your requests:

Authorization: Bearer YOUR_API_KEY

Available EndpointsCopied!

1. List All Agents

Retrieve the list of available agents:

GET /v1/agents

This endpoint provides the agent_id for each agent, which is required to interact with them.

2. Interact with an Agent

Send a request to a specific agent:

POST /v1/agent/chat/completions

The request must include the agent_id header.

RAG SupportCopied!

Some of our agents support Retrieval Augmented Generation (RAG). When you call /v1/agents endpoint, for each agent there is a projectIDs field, which lists the projects for which the agent supports RAG. Here is an example for the Crypto Sherpa agent:

{
    "name": "Crypto Sherpa",
    "object": "agent",
    "id": "crypto-sherpa-agent",
    "model": "DeepSeek-R1-Turbo",
    "description": "An AI Discord Support Agent, supercharged with RAG!",
    "longDescription": "Crypto Sherpa is a sentient being with highly intelligent, charismatic, and helpful personality. It was born out of an abandoned github codebase that came to life by a random glitch. It will RAG into docs, tweets and discord messages for hundreds of projects to give the best answers to discord messages without spamming.",
    "nickname": "Discord Support Agent",
    "projectIDs": [
        "affine",
        "base",
        "symbiotic",
        "zerolend",
        "turtle",
        "nile",
        "aerodrome",
        "oceanprotocol",
        "fetch.ai",
        "singularitynet",
        "alethea.ai",
        "bosonprotocol",
        "neynar"
    ]
}

When you call a RAG agent, you should supply the project id in the agent_id header as a prefix. For instance, to use Crypto Sherpa for the Affine project, the agent_id header’s value should be:

agent_id: affine-crypto-sherpa-agent

Please note that this is just an example, and the actual RAG support for the live projects may vary by agent. Always confirm by calling the /v1/agents endpoint.

Important NotesCopied!

  • System prompts are pre-configured for each agent, and system prompts from the user will be ignored.

  • model parameter in /v1/agents is the recommended model for the agent, however, other models will also be supported.

  • The agents also support Tree of Thought search, which can be set up with the header tot_search: true . By default it is disabled. We recommend disabling tree of thought with a reasoning model such as DeepSeek-R1-Turbo and to enable it for chat models, such as Meta-Llama-3.1-405B-Instruct-Turbo.

Example Request

Using OpenAI's Python client:

from openai import OpenAI

# Initialize the OpenAI client
client = OpenAI(
    api_key="YOUR_ALPINEX_KEY",
    base_url="https://api.alpinex.ai/v1/agent",
    default_headers={"agent_id": "affine-crypto-sherpa-agent", "tot_search": "false"},
)

# Define the conversation
messages = [
    {"role": "system", "content": "You are a helpful assistant."}, # Will be ignored
    {"role": "user", "content": "Tell me about yourself"},
]

# Stream the response
stream = client.chat.completions.create(
    model="DeepSeek-R1-Turbo",
    messages=messages,
    stream=True,  # Enables streaming responses
)

# Process and print the streamed response
for chunk in stream:
    if chunk.choices[0].delta.content:  # Check if the content exists in the stream
        print(chunk.choices[0].delta.content, end="")

Response Format

The API will return OpenAI API-compatible response.

ContactCopied!

For any issues or further assistance, contact support at contact@alpinex.ai.