For Google API users
Spend less on Google,
same code.
Change the base URL and add your Makas key. Your Google key stays yours, and Makas sends eligible requests to a lower-cost Google model.
Step 1
Two lineschange.
Gemini is called over plain HTTP here, so the example uses Python's standard library and there is no SDK to configure.
import json
import os
import urllib.request
request = urllib.request.Request(
"https://eu.makas.ai/proxy/google/v1beta/models/gemini-3.8-flash:generateContent",
data=json.dumps({"contents": [{"parts": [{"text": "Say hello"}]}]}).encode(),
headers={
"Content-Type": "application/json",
"Makas-Api-Key": os.environ["MAKAS_API_KEY"],
"X-Goog-Api-Key": os.environ["GOOGLE_API_KEY"],
},
)Set MAKAS_API_KEY and GOOGLE_API_KEY in your environment to your own keys, and keep both on your server.
TypeScript and cURL examples are in the Google quick start. Open the Google quick start
What you get
Routing thatexplains itself.
Endpoints, streaming included
generateContent and streamGenerateContent. Both buffered and streaming requests are routed.
Both prices, when they are known
Request Logs show the model you asked for and the model used. Cost and savings appear when usage and pricing are known: in response headers for buffered requests, and in Request Logs for streams once they end.
Your key, not ours
Your Google key travels in the X-Goog-Api-Key header with every request, and usage stays on your Google account. Makas reads its own key from Makas-Api-Key and removes it before forwarding.
Routing scope
What gets routed,what passes through.
Routed
Eligible text requests move to a lower-cost Google model when one fits. Capabilities, request shape and conversation continuity can keep a request on the model you asked for, and that is a normal outcome.
Routed routes
/proxy/google/v1beta/models/gemini-3.8-flash:generateContent/proxy/google/v1beta/models/gemini-3.8-flash:streamGenerateContent
Passed through
Embeddings, token counting and model lookups are forwarded in Google's own format, with the model you named. Interactions requests are forwarded too, and routing and cost metadata are not promised for that API.
Stays inside Google
Google requests stay with Google. Routing never switches provider.
Questions
Before you change that URL.
Which Google models does routing use?
Routing picks a lower-cost Google model for an eligible request. Which models qualify depends on the request and your routing rules, and each request records the model you asked for and the model used.
Do my prompts get stored?
Prompt plaintext is not persisted during normal routing. (Coming soon) Semantic caching is the exception. On Growth and up, it sends the prompt to OpenAI to create an embedding, including for requests to Anthropic and Google, keeps a SHA-256 hash and an unencrypted embedding, and stores the response encrypted per-customer. Retention is enforced, and there is no separate opt-out. It is off during the Founding period.
Do I still use my own Google key?
Yes. Send it with each request in its usual header, next to your Makas key. Provider usage stays on your own Google account.
What if I need a specific model?
Opt a routing group out in Routing Rules, or add a custom rule of your own; the Founding plan includes up to 10 custom rules. Requests that routing leaves alone keep the model you asked for.
Does streaming work?
Yes, streaming requests go through the same routing. A stream's final usage and cost are in Request Logs once it ends, not in response headers. While a monthly cap applies, which is always the case on Founding, a stream must target a model in the Makas model catalog, or it is rejected before it starts.
The Google reference covers endpoints, streaming and errors.
Read the Google reference