Getting Started with ShareAI API
This guide provides quick-start instructions for using the ShareAI decentralized network API, helping you set up and make your first requests effectively.
Step 1: Obtain Your API Key
- Navigate to the ShareAI Console API Keys page.
- Click Create New Key, enter a descriptive name, and securely save your API key. Remember, this key will only be shown once.
Step 2: Add User Credits
- Visit the Billing Page to manage your balance and add credits.
- Credits enable interaction with AI models available across the network.
Step 3: Make Your First API Call
Here’s how to structure a basic API request using the Chat Completions endpoint:
Endpoint URL:
POST https://api.shareai.now/api/v1/chat/completions
Request Headers:
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Request Body Example:
{
"model": "deepseek-r1:32b",
"messages": [
{
"role": "system",
"content": "You are a highly perceptive sentiment analysis model. Respond with one word: Positive, Neutral, or Negative."
},
{
"role": "user",
"content": "ShareAI makes decentralized AI easy and accessible!"
}
]
}
Replace YOUR_API_KEY
with the actual key obtained from your console