Los invisibles de la CDN

TE-API + your IA assistant

The same work with fewer tokens

Our customers have long been working with the Transparent Edge API to analyze real-time traffic, query historical data, provision sites and backends, or invalidate content.

Today there’s another way. TE-API is a command-line client written in Python that encapsulates and unifies our API into a single tool. It’s built from the OpenAPI specification, so endpoint coverage is automatically updated.

What does TE-API facilitate?

Authentication

TE-API handles OAuth2 automatically. There’s no need to request a token against the endpoint /v1/oauth2/access_token/ before each work session: simply store the credentials in a ‘.env’ file or define the environment variables TRANSPARENT_CLIENT_ID and TRANSPARENT_CLIENT_SECRET. The tool obtains the token and renews it as needed.

Manually constructing HTTP requests

The calls follow a hierarchical structure: te-api [MODULE] [VERB] [RESOURCE] [OPTIONS]

The module is the section of the API, the verb is the action (get, create, update, delete) and the resource is the concrete object.

  • Checking the current user is: te-api companies get current-user. 
  • List a company’s alerts: te-api companies get alerts <COMPANY_ID>
  • Set the default company: te-api set-company 12345 (and you stop repeating the identifier in each order).

The installation is a command with uv, and there are autocomplete scripts for bash, zsh, and fish.

Use case: traffic and history query

This is where the tool’s value truly shines. Traffic analysis involves a series of linked queries. You look at a site’s aggregated volume, detect an unusual time period, drill down into the fine details of that period, compare it to the same week of the previous month, and cross-reference it with response codes.

With manual HTTP requests, each of those steps involves managing a token, assembling a URL, encoding parameters, and parsing a response. With TE-API, each step is a command that you can chain together using standard terminal tools: redirecting to a file, filtering with jq, or adding it to a script that runs every morning.

The result is text in your terminal. You save it, version it, and go back over it as many times as needed.

MCP or command line? How to minimize consumption

An MCP server presents the API to an AI assistant in the form of tools. The model receives the definition of all of them (name, parameters, descriptions, response schema) before reading the first question. That text occupies a context window and is paid for in each conversation, whether the tools end up being used or not. In an API with dozens of endpoints, the definition alone is already a considerable block.

The second cost arises from chaining calls. The entire response from each tool is fed into the model, even if it only serves to feed the next call. In a traffic query with fine granularity, the returned string is long, and that string travels through the model in its entirety at each intermediate step. Anthropic has documented this pattern and proposes as an alternative that the model write code instead of invoking tools one by one.

TE-API covers much of that same work without carrying that cost.

How does AI fit into this flow?

The AI ​​writes the commands and you execute them.

You grant it access to the TE-API tool, explain what you want to know, and tell it to consult its help. It then returns the specific command, with the parameters and output format you need. You execute it in your terminal, or it executes it if you’re working with an assistant that has console access.

The savings have a mechanical explanation. What goes into the model is the tool’s documentation, once, and the text of your question. What comes out is a command line. The traffic data, which is the bulk of it, remains on your machine, in the file where you saved it.

Current models handle command-line syntax well, and an interface with a predictable structure like TE-API is easy for them to generate.

A pattern that works well

Ask the AI ​​to read the documentation, propose the complete sequence of commands for the analysis you have in mind, and explain what each one does. You review, execute, and pass it only the result you want to interpret. The terminal does the heavy lifting. The model translates your intention into syntax and reads the numbers you show it.

Where to begin

TE-API is published on GitHub and is free. You need Python 3.12 or higher and uv. The client credentials are the same as you already use with the API.

If your team currently works with the API using curl and custom scripts, the migration is straightforward: same endpoints, same authentication, less code to maintain.

Sources:

Sonia Arévalo is Product Marketing Manager in Transparent Edge.

How a Systems Analyst ended up studying Food Technology is hard to explain. Add to that her decision to then dedicate herself to Digital Marketing, and it becomes a complete enigma how this woman excels at so many things. More Argentinian than asado itself, Sonia maintains our website and social media by translating élfic technical jargon into something understandable for ordinary people. “Excellent” is her favorite interjection, which perfectly reflects her work.