Configure chat

September 29, 2026

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

Set how a notebook’s chat answers, the “Configure chat” dialog of the Gemini Notebook web app. The setting belongs to the notebook, so it applies to every later POST /chat question on it, and to chats in the web app.

  • goal is the conversational style: default, learning_guide, or custom with your own persona prompt. Sending persona alone sets the goal to custom.
  • length is the answer length: default, longer or shorter.

Google saves the goal and the length together, so whichever you leave out is set back to default. The response shows both values as saved.

https://api.useapi.net/v1/gemini-notebook/chat/settings

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
Request Body
{
  "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
  "persona": "You are a NASA flight controller. Answer in two sentences."
}
  • notebook is required, the notebook id. The id names its account, so no email is needed.
  • goal is optional, the conversational goal.
    Supported values: default, learning_guide, custom. Default: custom when persona is sent, otherwise default.
  • persona is optional, the custom goal’s prompt: the role, tone or rules the chat should follow. Required with goal: "custom" and rejected with any other goal.
    Length: 1 to 10,000 characters.
  • length is optional, the answer length.
    Supported values: default, longer, shorter. Default: default.

Provide goal, persona, length or any combination.

Responses
  • 200 OK

    The settings as saved.

    {
      "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
      "goal": "custom",
      "persona": "You are a NASA flight controller. Answer in two sentences.",
      "length": "default"
    }
    
    {
      "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
      "goal": "learning_guide",
      "length": "shorter"
    }
    
  • 400 Bad Request

    A missing or invalid parameter, nothing to change, or persona that does not match the goal.

    {
      "error": "persona is required with goal custom, and only then",
      "code": 400
    }
    
    {
      "error": "Provide goal, persona and/or length",
      "code": 400
    }
    
  • 401 Unauthorized

    Invalid API token.

    {
      "error": "useapi.net ⁝ Unauthorized",
      "code": 401
    }
    
  • 403 Forbidden

    The id was issued to a different API token.

    {
      "error": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55 does not belong to this API token",
      "code": 403
    }
    
  • 404 Not Found

    The notebook was deleted, or its account is no longer configured.

    {
      "error": "Not found on account [email protected] (Google s0tc2d grpc 5)",
      "code": 404
    }
    
  • 596 Account Error

    Google reported the account as signed out. While we re-check it, the answer is the first message below. Retry in about a minute. If it stays signed out, the account is paused, you receive an email, and the answer becomes the second message until you re-add it via Setup Gemini Notebook.

    {
      "error": "Google reported this account as signed out. We are re-checking it — please retry in about a minute. If it stays signed out, you will receive a re-add email.",
      "code": 596
    }
    
    {
      "error": "Account [email protected]: Google signed this account out. Re-add it at https://useapi.net/docs/start-here/setup-gemini-notebook",
      "code": 596
    }
    
  • 503 Service Unavailable

    Google is temporarily unavailable or is challenging our network. Retry in a few minutes. A 502 means Google answered with an unexpected error.

    {
      "error": "Google is temporarily unavailable (s0tc2d grpc 14), please retry",
      "code": 503
    }
    
Model
{ // TypeScript, all fields are optional
  notebook: string
  goal: 'default' | 'learning_guide' | 'custom'
  persona?: string             // goal custom only
  length: 'default' | 'longer' | 'shorter'
  error: string                // error responses only
  code: number                 // error responses only, the HTTP status
}
Examples
  • curl -X POST "https://api.useapi.net/v1/gemini-notebook/chat/settings" \
       -H "Content-Type: application/json" \
       -H "Authorization: Bearer …" \
       -d '{ "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55", "goal": "learning_guide", "length": "shorter" }'
    
  • const token = "API token";
    const apiUrl = "https://api.useapi.net/v1/gemini-notebook/chat/settings";
    const response = await fetch(apiUrl, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        "Authorization": `Bearer ${token}`,
      },
      body: JSON.stringify({
        notebook: "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
        persona: "You are a NASA flight controller. Answer in two sentences."
      })
    });
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    token = "API token"
    apiUrl = "https://api.useapi.net/v1/gemini-notebook/chat/settings"
    headers = {
        "Content-Type": "application/json",
        "Authorization" : f"Bearer {token}"
    }
    data = {
        "notebook": "user:[email protected]:d02c903b-17f8-4241-a263-2be9e7359d55",
        "goal": "default",
        "length": "default"
    }
    response = requests.post(apiUrl, headers=headers, json=data)
    print(response, response.json())
    
Try It