Skip to main content
POST
/
api
/
v1
/
ai
/
chat
Run a chat model
curl --request POST \
  --url https://api.oryntai.xyz/api/v1/ai/chat \
  --header 'Content-Type: application/json' \
  --header 'X-Network: <x-network>' \
  --data '
{
  "model": "gpt-4.1",
  "prompt": "Hello, world!",
  "messages": [
    {}
  ],
  "input": [
    {}
  ],
  "temperature": 0.7,
  "max_tokens": 256,
  "options": {}
}
'
{
  "id": "chat-123",
  "model": "gpt-4.1",
  "response": "Hello! How can I assist you today?",
  "usage": {
    "tokens": 35
  }
}

Headers

X-Network
string
required

Blockchain network to use (e.g., solana, solana-devnet, base, polygon)

X-PAYMENT
string

On-chain payment proof for HTTP 402 requests

Body

application/json
model
string
required

Model to use

Example:

"gpt-4.1"

prompt
string

Optional prompt text

Example:

"Hello, world!"

messages
object[]

Messages array or string input for chat models

input
object[]

Input text or array for chat/completion

temperature
number

Temperature setting

Required range: 0 <= x <= 2
Example:

0.7

max_tokens
number

Maximum tokens for completion

Required range: x >= 1
Example:

256

options
object

Provider-specific extra fields

Response

Chat response from AI model