Your First API Call
The Arcee Platform API is OpenAI compatible. It can be accessed through your command line, or, with minor configuration changes, through the OpenAI SDK.
Parameter
Value
api_key
curl -X POST "https://api.arcee.ai/api/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <Arcee Platform API Key>" \
-d '{
"model": "arcee-ai/AFM-4.5B",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Greetings!"}
],
"stream": false
}'from openai import OpenAI
client = OpenAI(
api_key="<Arcee Platform API Key>",
base_url="https://api.arcee.ai/api/v1")
response = client.chat.completions.create(
model = "arcee-ai/AFM-4.5B", # Change to whichever Arcee AI model you want to invoke
messages = [
{"role":"system", "content":"You are a helpful assistant"},
{"role":"user", "conent": "Hello"},
],
steam = false
)
print(response.choices[0].message.content)
import OpenAI from "openai";
const openai = new OpenAI({
baseURL: 'https://api.arcee.ai/api/v1',
apiKey: '<Arcee Platform API Key>'
});
async function main() {
const completion = await openai.chat.completions.create({
messages: [{ role: "system", content: "You are a helpful assistant." }],
model: "arcee-ai/AFM-4.5B",
});
console.log(completion.choices[0].message.content);
}
main();Last updated

