Open DocumentationOpen Docs

OpenAgent API

OpenAgent API documentation

POST
/v1/chat/completions

Create a chat completion

Create a model response for the given chat conversation. This endpoint is compatible with OpenAI's API and processes the chat through a workflow agent that can utilize various tools and capabilities to provide comprehensive responses.

/v1/chat/completions

Request Body

application/jsonRequired

model
Required
Model

The language model to use for the chat completion, e.g. 'qwen2', 'mistral', 'qwen2.5', 'llama3.1', 'llama3.2', 'mistral-nemo'

messages
Required
Messages

temperatureTemperature

top_pTop P

nN

streamStream

Default: false

stopStop

max_tokensMax Tokens

presence_penaltyPresence Penalty

frequency_penaltyFrequency Penalty

userUser

curl -X POST "https://agent.open.network/v1/chat/completions" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "llama3.2",
    "messages": [
      {
        "content": "What's the current price of Ethereum and its market trend?",
        "role": "user"
      }
    ],
    "temperature": 0.7,
    "top_p": 1,
    "n": 1,
    "stream": false,
    "stop": [],
    "max_tokens": 0,
    "presence_penalty": 0,
    "frequency_penalty": 0,
    "user": "oa"
  }'

Successful response

{
  "id": "chatcmpl-123abc",
  "object": "chat.completion",
  "created": 1677858242,
  "model": "gpt-4o-mini",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Based on current market analysis, Bitcoin is showing significant momentum..."
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 50,
    "completion_tokens": 100,
    "total_tokens": 150
  }
}