Inference API
Enable tools
Combine QDivZero tools and your own function tools in a standard chat completion.
Platform and application tools
Web search, browser, find and Retrieval are identified by their type. Function tools are forwarded to the model unchanged and returned to your application for execution.
Request shape
Add tools to the standard tools array. Tool availability depends on the selected model and workload.
1{"tools":[{"type":"web_search"},{"type":"function","function":{"name":"lookup_order","parameters":{"type":"object"}}}]}Flexible Vector Database
Configure flexible_vector_database_search in the tools array to make a selected database available to the model. The type flexible_vector_database is also accepted as an alias. Existing account authorization and tool permissions apply.
- vector_database: the slug of the selected database.
- allow_write: optional boolean, false by default. When true, the model can use put, delete and purge on the selected database as well as search.
- description: optional string that tells the model when or for what purpose to use the database.
- put creates or replaces the complete document. delete removes one chunk; purge removes all chunks of a document.
Vector database with Chat Completions
Use a database as shared memory across conversations that configure it. With allow_write set to true, the model can store information as well as search it. Send this request body to POST /v1/chat/completions; replace my-model and global-memory with your model and database slug.
1{
2 "model": "my-model",
3 "messages": [{"role": "user", "content": "Remember that our product uses a dark theme."}],
4 "tools": [{
5 "type": "flexible_vector_database_search",
6 "vector_database": "global-memory",
7 "allow_write": true,
8 "description": "Use this database as shared global memory for information that should persist across conversations."
9 }]
10}Vector database with Responses
Use a database of frontend designs as a read-only reference. Omitting allow_write leaves it false, so the model can search without write operations. Send this request body to POST /v1/responses; replace my-model and frontend-designs with your model and database slug. The alias uses the same configuration fields.
1{
2 "model": "my-model",
3 "input": "Find the frontend design guidelines for buttons.",
4 "tools": [{
5 "type": "flexible_vector_database",
6 "vector_database": "frontend-designs",
7 "description": "Use this database to find frontend designs and design guidelines."
8 }]
9}API example
Send a function to the model. If it returns a call, your application must execute the function and send the result in a later turn. Replace my-model with one that supports functions.
Set QDIV0_API_KEY to an account tk_ key or personal uk_ key. A personal key uses its default account unless you select another with X-Account-ID.
1curl --fail-with-body \
2 --request POST \
3 "https://api.qdiv0.com/v1/chat/completions" \
4 -H "Authorization: Bearer $QDIV0_API_KEY" \
5 -H "Content-Type: application/json" \
6 --data '{"model":"my-model","messages":[{"role":"user","content":"Hello"}],"tools":[{"type":"function","function":{"name":"lookup_order","description":"Look up an order","parameters":{"type":"object","properties":{"order_id":{"type":"string"}},"required":["order_id"]}}}]}'