Skip to documentation
DEVELOPER DOCS / HASHBIDXMODEL ACCESS. ONE INTEGRATION.

OpenAI compatible

Chat Completions

An OpenAI Chat Completions compatible endpoint for most chat models, with tool calling and SSE streaming.

POST/v1/chat/completions

Key request parameters

ParameterTypeDescription
modelstring · RequiredModel ID from GET /v1/models
messagesMessage[] · RequiredOrdered system, user, assistant, or tool messages
streambooleanWhether to return an SSE stream; defaults to false
temperaturenumberSampling temperature, from 0 to 2
max_tokensintegerMaximum number of generated tokens
toolsTool[]Functions the model can call

Key response parameters

ParameterTypeDescription
idstringResponse ID
choicesChoice[]Candidate outputs with message and finish_reason
usageobjectprompt_tokens, completion_tokens, and total_tokens
modelstringActual inference model
X-HashBid-Costdecimal stringCharge for this call (response header, non-streaming requests only); currency in X-HashBid-Cost-Currency

Integration examples

Replace the API key and model ID in these examples with your values.

cURL
cURL
curl https://hashbidx.ai/v1/chat/completions \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<MODEL_ID>",
    "messages": [{"role": "user", "content": "Hello, HashBid"}],
    "max_tokens": 1024
  }'
Python
Python
from openai import OpenAI

client = OpenAI(
    api_key="<YOUR_API_KEY>",
    base_url="https://hashbidx.ai/v1",
)

result = client.chat.completions.create(
    model="<MODEL_ID>",
    messages=[{"role": "user", "content": "Hello, HashBid"}],
)
print(result.choices[0].message.content)
Node.js
Node.js
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: "<YOUR_API_KEY>",
  baseURL: "https://hashbidx.ai/v1",
});

const result = await client.chat.completions.create({
  model: "<MODEL_ID>",
  messages: [{ role: "user", content: "Hello, HashBid" }],
});
console.log(result.choices[0].message.content);
Go
Go
body, _ := json.Marshal(map[string]any{
  "model": "<MODEL_ID>",
  "messages": []map[string]any{
    {"role": "user", "content": "Hello, HashBid"},
  },
})
req, _ := http.NewRequest("POST",
  "https://hashbidx.ai/v1/chat/completions", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer <YOUR_API_KEY>")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
Rust
Rust
let response = reqwest::Client::new()
    .post("https://hashbidx.ai/v1/chat/completions")
    .bearer_auth("<YOUR_API_KEY>")
    .json(&serde_json::json!({
        "model": "<MODEL_ID>",
        "messages": [{"role": "user", "content": "Hello, HashBid"}],
    }))
    .send().await?;
let body: serde_json::Value = response.json().await?;

If the response includes X-Request-Id, include it when troubleshooting an issue.

All API endpoints
BUILD WITH HASHBIDX

Find your model. Make your first call.

Models & pricing