Skip to content

Assistants API

Use the Assistants API to configure a GPTunneL assistant and exchange messages with it from your application.

  • Send a message to an assistant in one API request.
  • Configure its behavior in the web interface. Saved settings apply to subsequent requests.
  • Reuse a chatId and set maxContext to include earlier messages in a conversation.
  • Choose from Claude, GPT, and other models.
  • Connect a RAG knowledge base or an external API.

Send authenticated POST requests with a JSON body.

The interaction scheme

  1. Get an API key.
  2. Create an assistant — from the dashboard (see the blog guide) or by calling assistant/create.
  3. Save the mention returned when you create the assistant. Pass it as assistantCode to chat with the assistant.
  4. To continue a conversation, reuse the same chatId and set maxContext.

How do you change the assistant model?

Change the model in the web interface or call assistant/update. Subsequent requests use the new model.

How do I change the assistant’s behavior?

Set the instructions, temperature, and other options in the web interface or pass them to assistant/create or assistant/update.

Can you use your own data?

Yes. Add the relevant information to the assistant’s instructions or its RAG knowledge base.

Is it possible to send images?

Yes. Pass the image URLs in images.

How do I keep conversation history?

Reuse the same chatId throughout the conversation and set maxContext to a value from 1 to 20. With maxContext: 0, the model receives only the current turn.


Integration issues in Telegram: t.me/gptunnel_ru or @ScriptHeads