Akash Chat API - Documentation
The Akash Chat API is compatible with the OpenAI API standard. See the examples below for how to interact with the API.
If you need help or have questions, please reach out to us in the Akash Discord at:
https://discord.com/invite/akash
https://discord.com/invite/akash
Available Models
Model ID |
---|
Meta-Llama-3-1-8B-Instruct-FP8 |
Meta-Llama-3-1-405B-Instruct-FP8 |
Example: With Python and the OpenAI SDK
import openai
import textwrap
client = openai.OpenAI(
api_key="sk-xxxxxxxx",
base_url="https://chatapi.akash.network/api/v1"
)
response = client.chat.completions.create(
model="Meta-Llama-3-1-8B-Instruct-FP8",
messages = [
{
"role": "user",
"content": "Who are you?"
}
],
)
print(textwrap.fill(response.choices[0].message.content, 50))
Example: With Curl and Python
curl https://chatapi.akash.network/api/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer sk-xxxxxxxx" \
-d '{
"model": "Meta-Llama-3-1-8B-Instruct-FP8",
"messages": [
{
"role": "user",
"content": "Who are you?"
}
]
}' | python3 -c '
import json
import sys
json.dump(json.load(sys.stdin), sys.stdout, indent=2)
print()
'