application
to minimize breaking changes./applications
endpoint to generate content from no-code agents.
If you do not have a deployed no-code agent, follow the guides to build an agent with text generation or research capabilities in AI Studio.
/applications
endpoint supports only agents with text generation and research capabilities. It does not support chat agents..env
file with the name WRITER_API_KEY
.POST https://api.writer.com/v1/applications/{application_id}
/applications
endpoint will result in charges for model usage. See the pricing page for more information.Parameter | Type | Description |
---|---|---|
application_id | string | The ID of the deployed agent. You can find this in the URL of the agent in AI Studio: https://app.writer.com/aistudio/organization/<organization-id>/applications/<application-id> . You can also use the List applications endpoint to get the list of deployed agents and see the application ID. |
/applications
endpoint.
Parameter | Type | Description |
---|---|---|
inputs | array | Input values matching the agent’s defined input fields. The input structure depends on the agent capabilities. |
inputs[].id | string | The name of the input field. For research, the input id is always query . |
inputs[].value | array[string] | An array containing values of the input field. You can pass multiple values for a single input field. If the input field is a file, the value should be the file_id from an uploaded file, such as ["1234-abcd-1234"] . Learn more about how to upload files with the Files API. |
stream
parameter to true
or false
. Only agents with research support streaming responses at this time.
stream
parameter to false
, the response is delivered as a JSON object with the following parameters:
Parameter | Type | Description |
---|---|---|
title | string | The name of the output field, as defined in the application. |
suggestion | string | The output of the application call. |
stream
parameter to true
, the response is delivered as server-sent events. The event contains several parameters.
The content of the chunk is in the delta
field. You can also use the stages
field to get the stages of the research assistant application call, such as “Planning the research” or “Researching and organizing findings.”
Below are the important parameters for extracting the output of the application call.
Parameter | Type | Description |
---|---|---|
delta | object | The content of the chunk. |
delta.content | string | The output of the application call. |
delta.stages | array | The stage of the research assistant application call. |
delta.stages.content | string | The content of the stage. |
Get application
endpoint to get the list of required inputs with their name and types.
inputs
parameter is an array of objects, each containing an id
and value
field. The id
field is the name of the input field, and the value
field is the value of the input field.
file_id
from an uploaded file.
Your request body should be formatted as a JSON object with values for each input.
Product description
and Target audience
.
id
and value
parameters. It also takes a stream
parameter that is set to false
by default.
Parameter | Type | Description |
---|---|---|
inputs | array | An array of objects, each containing an id and value field. |
inputs[].id | string | The name of the input field. For research assistant applications, the input id is always query . |
inputs[].value | array[string] | An array containing the research query. |
stream | Boolean | Whether to stream the response. Defaults to false . |