- Load balance between multiple sessions
- Automatically handle "puter" authentication
- Full API documentation on landing page
- Ability to test the API right through the landing page.
- Validation that the authentication is working.
- Add simple Chat interface UI (for testing, etc.)
- Documentation
- Create nice landing page with basic info (link to github, etc.).
- Add JSON & Markdown formatting
- Add ability to API copy code snippets.
- Extract API Key and impliment basic security.
- Improve README.md documentation
- Add LICENSE
curl http://localhost:8788/api/v1/models
curl http://localhost:8788/api/v1/models
-H "Authorization: Bearer sk-test-123456789"
curl http://localhost:8788/api/v1/chat/completions
-H "Authorization: Bearer sk-test-123456789"
-H "Content-Type: application/json"
-d '{
"model": "claude-3-5-sonnet",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}'
{ "error": { "message": "Error description", "type": "invalid_request_error", "param": null, "code": "invalid_auth" } }
cd sonnet_api npm install npm start
curl http://localhost:3000/api/v1/models
-H "Authorization: Bearer sk-test-123456789"
curl -k https://api.cyopsys.com/v1/models
-H "Authorization: Bearer sk-test-123456789"
curl -k https://api.cyopsys.com/v1/chat/completions
-H "Authorization: Bearer sk-test-123456789"
-H "Content-Type: application/json"
-d '{
"model": "claude-3-5-sonnet",
"messages": [{"role": "user", "content": "Hello"}],
"stream": true
}'
import OpenAI from 'openai';
const openai = new OpenAI({ baseURL: 'https://api.cyopsys.com', apiKey: 'sk-test-123456789' });
// List models const models = await openai.models.list();
// Create chat completion const stream = await openai.chat.completions.create({ model: 'claude-3-5-sonnet', messages: [{ role: 'user', content: 'Hello!' }], stream: true });
Note: The implementation now provides a robust OpenAI-compatible API that works in both local development and production environments, with proper error handling and SSL support.