API Documentation:
SIA-Safe intelligent assistant
Release Date:
December 12, 2024
Your Tech Club
This documentation covers the API endpoints and authentication methods for SIA API service.
Authentication
All API requests require an API key passed in the Authorization header:
Authorization: Bearer {YOUR_API_KEY}
API Key Formats
- Prefix:
sk-
- Example:
sk-c6d736e121****************87h8b46c
Endpoints
1. Model Retrieval
- Endpoint:
GET http://sia.yourtechclub.org/api/models
- Description: Retrieve available AI models
- Authentication: Required
- Response: List of available models
Example Request
curl -H "Authorization: Bearer {API_KEY}" http://sia.yourtechclub.org/api/models
2. Chat Completions
- Endpoint:
POST https://sia.yourtechclub.org/api/chat/completions
- Description: Generate AI-powered chat completions
- Method: POST
- Authentication: Required
Request Parameters
{
"model": "model_name",
"messages": [
{
"role": "user",
"content": "What is safe intelligence assistance?"
}
]
}
Example Request
curl -X POST https://sia.yourtechclub.org/api/chat/completions \
What is safe intelligence assistance?
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"model": "model_name",
"messages": [
{
"role": "user",
"content": ""
}
]
}'
3. Knowledge Collection File Addition
- Endpoint:
POST https://sia.yourtechclub.org/api/v1/knowledge/{knowledge_id}/file/add
- Description: Add a file to a knowledge collection
- Method: POST
- Authentication: Required
Request Parameters
{
"file_id": "specific-file-identifier"
}
Example Request
curl -X POST https://sia.yourtechclub.org/api/v1/knowledge/{knowledge_id}/file/add \
-H "Authorization: Bearer {API_KEY}" \
-H "Content-Type: application/json" \
-d '{"file_id": "your-file-id"}'
Error Handling
Common HTTP Status Codes:
200 OK
: Successful request400 Bad Request
: Invalid request format401 Unauthorized
: Invalid API key403 Forbidden
: Insufficient permissions404 Not Found
: Resource not found
Best Practices
- Always use HTTPS for secure communications
- Protect your API keys
- Handle potential errors in your implementation
- Validate inputs before sending requests
Support
For additional support, contact YourTechClub support team.
Version: Preliminary Documentation v1.0 Last Updated: December 12, 2024