Section 02 · API Methods
API Methods
Endpoint kami menggunakan standar yang kompatibel dengan OpenAI API, sehingga kamu bisa menggunakan library standar seperti openai-python atau langchain.
Base URL
https://offline.juxtalabs.io
List Models
GET/v1/models
Gunakan endpoint ini untuk mengecek status dan model apa saja yang sedang running di server.
Headers
| Name | Value |
|---|---|
Content-Type | application/json |
Authorization | Bearer <token> |
Request
curl -X GET "https://offline.juxtalabs.io/v1/models" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://offline.juxtalabs.io"
)
models = client.models.list()
for model in models.data:
print(model.id)Response
{
"data": [
{
"id": "DeepSeek-V3.1"
}
]
}{
"message": "Unauthorized",
"request_id": "ebf75436505dab6a69d35b04def99c5a"
}Chat Completions
POST/v1/chat/completions
Endpoint utama untuk berinteraksi dengan model LLM.
Headers
| Name | Value |
|---|---|
Content-Type | application/json |
api-key | API Key |
Body
| Name | Type | Description |
|---|---|---|
model | string | Model Name |
messages | list of objects | Message Payload |
temperature | float | Temperature ( > 0 ) |
stream | bool | Streaming Mode |
Request
curl -X POST "https://offline.juxtalabs.io/v1/chat/completions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "DeepSeek-V3.1",
"messages": [
{"role": "user", "content": "Hello!"}
],
"temperature": 0.7,
"stream": false
}'from openai import OpenAI
client = OpenAI(
api_key="YOUR_API_KEY",
base_url="https://offline.juxtalabs.io"
)
response = client.chat.completions.create(
model="DeepSeek-V3.1",
messages=[
{"role": "user", "content": "Hello!"}
],
temperature=0.7,
stream=False
)
print(response.choices[0].message.content)Response
{
"id": "resp-054e64b5578b4458b27fecccc76b43ae",
"choices": [
{
"finish_reason": "stop",
"index": 0,
"message": {
"content": "<think>Hmm, user bertanya tentang ibu kota Indonesia. Ini...",
"refusal": null,
"tool_calls": null,
"role": "assistant"
}
}
],
"created": 1777803512,
"model": "DeepSeek-V3.1",
"object": "chat.completion",
"usage": {
"completion_tokens": 420,
"prompt_tokens": 13,
"total_tokens": 433,
"completion_tokens_details": null,
"prompt_tokens_details": {
"audio_tokens": 0,
"cached_tokens": 0
}
}
}{
"message": "Unauthorized",
"request_id": "f5231f735818f858eb2d4b72a96ec170"
}Last updated · 2 days agoJuxta Labs · Jakarta