ModelsPricingTutorialsBlogFAQ
Home/Tutorials/cURL quickstart
Tutorial · cURL

Verify connectivity with cURL

Once you have a key, one curl command is the fastest way to verify.

Chat Completions (OpenAI-compatible)

curl https://api.lowcostaiapi.com/v1/chat/completions \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'

Sample response

A successful call returns a standard structure:

{
  "choices": [{
    "message": { "role": "assistant", "content": "Hello! ..." }
  }],
  "usage": { "total_tokens": 23 }
}

A 401 usually means a wrong key; a 404 means you should check the base URL path.