REST API
REST API
Section titled “REST API”Panduan menggunakan AI API SemutSSH via REST API.
Base URL
Section titled “Base URL”https://ai.semutssh.comAuthentication
Section titled “Authentication”Gunakan header Authorization dengan API key:
Authorization: Bearer sk-semut-xxxxxxxxxxxxEndpoint Chat Completions
Section titled “Endpoint Chat Completions”POST /chat/completionsRequest
Section titled “Request”curl https://ai.semutssh.com/chat/completions \ -H "Authorization: Bearer sk-semut-xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "model": "claude-sonnet-4-20250514", "messages": [ {"role": "user", "content": "Hello, Claude!"} ] }'Response
Section titled “Response”{ "id": "chatcmpl-xxx", "object": "chat.completion", "created": 1234567890, "model": "claude-sonnet-4-20250514", "choices": [ { "index": 0, "message": { "role": "assistant", "content": "Hello! How can I help you today?" } } ]}Kompatibilitas
Section titled “Kompatibilitas”API 100% kompatibel dengan format OpenAI, sehingga Anda dapat menggunakan OpenAI SDK dengan mengganti base URL.