This guide explains the Applications endpoint, which generates content from deployed no-code applications with inputs.

The Applications API allows you to turn deployed no-code applications into microservices, which can also be used as tools in tool calling. Business users can define inputs, prompts, and outputs, and developers can then add them to other applications, UIs, or services.

Your API key can be generated using these steps.

Overview

The /applications endpoint generates content based on inputs provided to a specific no-code application created in AI Studio. When calling the endpoint, you’ll need:

  • The application_id of your deployed application, which is the unique identifier of a no-code application in AI Studio
  • Input values matching the application’s defined input fields
  • For file inputs, a file_id from the Files API

Using the /applications endpoint will result in charges for model usage. See the pricing page for more information.

Text generation applications

Text generation applications generate content based on the inputs provided to a specific no-code application created in AI Studio. This is a great way to enable business users to control prompts and outputs while still allowing developers to add them to other applications, UIs, or services.

Request format

For text generation applications, the request body will have the following format:

{
  "inputs": [
    {
      "id": "string",
      "value": ["string"]
    }
  ]
}

Example request

Here’s an example of how to call the /applications endpoint using cURL and the Writer Python and Node SDKs:

Response format

Text generation applications return a JSON response with the following format:

{
  "title": "string",
  "suggestion": "string"
}

Research assistant applications

Research assistant applications output a final report after performing research in stages. Because of this, they support streaming responses.

Request format

Research assistant applications have similar request formats to text generation applications, but include a stream field:

{
  "inputs": [
    {
      "id": "query",
      "value": ["string"]
    }
  ],
  "stream": true
}

Note that these applications will always include an input with the id of query to capture the user’s query.

Example request

Streaming response format

Each streamed chunk contains:

{
    "delta": {
        "title": "Research output",
        "content": "Partial response content...",
        "stages": [
            {
                "id": "1234",
                "content": "Stage description",
                "sources": ["source1", "source2"]
            }
        ]
    }
}

Using applications with tool calling

You can use deployed no-code applications as tools in your tool calling implementation. This allows you to combine the power of no-code applications with other tools and APIs. See the applications tool calling guide for implementation details.

Implementation steps

1

Create your application

Build a text generation or research assistant application in AI Studio.

2

Deploy the application

Deploy your application to get an application ID.

3

Get the code snippet

Use the “View code” button in AI Studio to get a starter code snippet.

4

Copy code snippet

Copy the displayed code snippet. You can choose between cURL, Python, or JavaScript.

5

Implement error handling

Handle potential errors and respect rate limits.

For more details on building applications, see the AI Studio No-code documentation.