OhMyGPT

Chat Completions

Generate chat completions with text and tool calls.

Work in progress

OpenAPI specification and detailed schema documentation coming soon.

Endpoint

POST /v1/chat/completions

Request body

FieldTypeRequiredDescription
modelstringYesModel identifier
messagesarrayYesConversation messages
streambooleanNoEnable streaming
max_tokensintegerNoMaximum tokens to generate
temperaturefloatNoSampling temperature (0-2)
toolsarrayNoTool definitions

See Parameters for complete parameter reference.

Response

{
  "id": "chatcmpl-...",
  "object": "chat.completion",
  "created": 1234567890,
  "model": "gpt-4o",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": "Hello! How can I help you today?"
      },
      "finish_reason": "stop"
    }
  ],
  "usage": {
    "prompt_tokens": 10,
    "completion_tokens": 15,
    "total_tokens": 25
  }
}

How is this guide?

Last updated on

On this page