Services and AI usage
Use a service when a survey needs AI to interpret an answer, such as grouping an open-text response before choosing the next question. A script calls the service by name and receives a structured result that it can use in its normal routing and calculations.
Set up a service
- Open QubeSurvey, choose Services, and select your account. You need permission to manage its services.
- Choose New service. Give it a short Service key and a
Display name, then choose a Model (
deepseek-chat,deepseek-v4-flash, ordeepseek-flash; participant Runs requiredeepseek-flashordeepseek-v4-flash). - Write the Prompt to describe the task and the information the model receives. Set Output schema (JSON) to the fields and types the script expects. If you provide Fallback result (optional JSON), it must also match that schema. It supplies a result if the provider cannot complete the request. Your AI agent can help write the prompt and result format to match your script.
- Choose Create service. The service is saved as a draft. Later changes use Save draft; choose Publish saved draft when that version is ready for a Run.
Before publishing, test how the script handles the result. In the Script debugger, use Mock preview to apply a sample JSON response without calling the model or saving a result. Use Live preview only when needed: it sends the request to the configured model provider and uses Account credit, up to 0.25 in the Account currency per call.
Select it for a Run
- Open the Run’s Settings and find Published service bindings.
- Choose Add binding. The Script’s
service.call(...)names are listed for you with the newest matching published version preselected; confirm or override each. Enter a name yourself only for a service the review cannot reach (for example a name computed at runtime). - Choose Save bindings. The Run uses that version for future starts. Changing or publishing a service later does not change this binding; edit and save the Run’s binding to select another version. Interviews already underway keep the version they started with.
The script decides how to use the returned result. Check routing, error handling and what happens if the service fails, using test data before fieldwork.
Costs and data
Hosted service calls are charged to the selected Account’s shared usage balance
at measured provider cost plus 50%, within the spending limit set for the task.
Check People, access and billing before live testing or
fieldwork. AI agents you run yourself use their own provider accounts and pricing;
the local qube commands do not use hosted AI credit.
QubeSurvey sends the service prompt and call input to its configured model provider. Send only the information needed for the task, and use invented responses when testing. The script controls which results the participant sees.
See Managing fieldwork for Run operations and Use qube with an AI agent for agent use.