AlpineX LLM ServicesGuideReference

Quickstart Guide

Welcome to AlpineX’s LLM Inference Service! This guide will help you get started quickly with our API to integrate advanced language processing capabilities into your applications.

Step 1: Sign Up and Create an API KeyCopied!

  1. Create an Account

    • Visit our dashboard to sign up for a new account.

  2. Generate an API Key

    • After logging in, navigate to the API Keys section.

    • Click on Create New API Key.

    • Important: Save your API key securely. We cannot recover it for you. If you lose your API key, you will need to generate a new one from the dashboard.

  3. API Key Usage

    • Include your API key in all API requests by setting it in the Authorization HTTP header:

      Authorization: Bearer YOUR_API_KEY

Step 2: Purchase CreditsCopied!

  1. Free Credits

    • Each new account receives $1 worth of free credits to get you started.

  2. Top Up Your Account

    • For additional credits, log in to the dashboard and navigate to the Billing section.

    • Choose a top-up amount and complete the payment process.

Step 3: Make API CallsCopied!

Our service is compatible with OpenAI's chat API endpoints. You can use OpenAI's official Python client library to interact with our API by specifying a custom API base URL and using your AlpineX API key.

Python Example Using OpenAI's Client

from openai import OpenAI

# Initialize the OpenAI client
client = OpenAI(
    api_key="YOUR_ALPINEX_KEY",
    base_url="https://api.alpinex.ai/v1",  # Custom API base
)

# Define the conversation
messages = [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "Who are you?"},
]

# Stream the response
stream = client.chat.completions.create(
    model="Meta-Llama-3.1-405B-Instruct-Turbo",  # Replace with your model
    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="")

Additional InformationCopied!

API Documentation

For detailed information on API endpoints, parameters, and error codes, please refer to our API Documentation.

Need Help?

Copied!