Skip to content

Send your first query

Outcome: receive a nonempty answer from the backend and identify the model that answered.

Prerequisite: a running backend that passes verification. Use WSL Bash in a second terminal. Start with non-sensitive sample text.

Terminal window
read -rsp 'API key: ' API_KEY
echo
export API_KEY

Enter the key configured for your backend. This hides the input; it does not change the server. Keep shell tracing off. The current backend logs a token prefix, so use a lab credential.

Terminal window
curl --fail-with-body --silent --show-error \
http://localhost:8000/api/v1/query \
-H "Authorization: Bearer $API_KEY" \
-H 'Content-Type: application/json' \
-d '{"query":"Explain what a Git commit records in two sentences.","user_id":"lab-user"}'

Look for:

FieldMeaning
responseThe generated answer; text varies between runs
modelThe model actually selected
routing_infoSelection reason and routing state
sourcesRetrieved documents, if any; an empty result is normal for an empty store
conversation_idThread identifier when memory is enabled; otherwise null

Success means an HTTP 200 response with a nonempty answer. A healthy /health alone does not demonstrate inference.

403 usually indicates a missing or invalid bearer credential; 422 indicates invalid input; 429 indicates the request limit; 500 can indicate an Ollama or storage error. Check the response and troubleshooting guide. Avoid repeatedly retrying a slow generation.

Terminal window
unset API_KEY

Next: Choose a model or complete the API lab.