Our API offers the following formats for running agents:
Execute Agent (Synchronous)
Execute Agent Stream (Asynchronous with Streaming)
OpenAI-compatible API
This format runs the agent synchronously, meaning the API call waits until everything is finished before giving you a response.
How It Works:
You send a request to run the agent and get a complete JSON response with:
A detailed log of each step of the execution (thoughts, tool calls, results).
The final answer generated by the agent.
When To Use:
Simple integrations where you just need the final result and don't need real-time feedback.
Batch processing or report generation.
Cases where latency isn't a critical concern.
Advantages:
Easier and more straightforward to implement.
Less complexity on the client side, since you get a single response.
Disadvantages:
Higher apparent latency, since the client has to wait until the whole run is finished.
Not suitable for real-time interactive interfaces.
This format runs the agent asynchronously, giving real-time feedback through a data stream (streaming).
How It Works: You send a request to run the agent with the streaming parameter enabled. The API establishes a persistent HTTP connection and sends incremental events as the agent makes progress:
Thought tokens being generated.
Tool commands being triggered and their results.
The final response being built in pieces.
When To Use:
Real-time chat interfaces.
Showing progress and logs in real time.
Apps where the user experience gets better with instant feedback.
Advantages:
Lower perceived latency since the client gets data as it comes.
Makes the user experience better by allowing real-time interactivity.
Disadvantages:
More complex to implement on the client side, since you have to handle data streams.
Higher network resource usage since multiple chunks of data get sent.
This format gives you an API that follows the OpenAI API standards, making it easier to integrate with existing tools and libraries.
How it Works: The Tess AI API uses the same call patterns, data formats, and authentication as the OpenAI API. This makes it possible for you to use standard OpenAI clients and integrations with Tess AI’s API, so there’s less need for changes.
When to Use:
When you already have apps or clients designed to work with the OpenAI API.
To make it easier to move or connect with existing systems based on OpenAI.
To take advantage of libraries and frameworks that support the OpenAI API.
Advantages:
Compatible with the OpenAI ecosystem.
Easy integration and migration.
Less development time since you can use existing tools.
Disadvantages:
Might not give you access to every Tess AI API-specific feature.
The table below sums up the main differences between the formats and helps you pick the best option for your use case:
Feature | Execute Agent | Execute Agent Stream | OpenAI-compatible API |
Time to 1st reply | After everything's done | Instant (first token) | Depends on the operation |
Apparent latency | Higher | Lower | Variable |
Client complexity | Low | Medium | Low to Medium |
Interactivity | None | High | Depends |
Typical use cases | Batch processing, reports | Real-time chat, live logs | Integration with OpenAI tools |
When choosing the agent execution format in the Tess AI API, think about your app’s specific needs, if you need real-time feedback, and if it works with your current tools. Check out the pros and cons of each option to make sure your users have the best experience and your app runs smoothly.
If you have questions or need help picking the best format, just reach out to our support team!!