Baseten API: connect a model to your coding tools

Connect a coding client to Baseten Model APIs, check the exact model and endpoint, and keep a useful record of what your tests showed.

Updated 4 min read

To use the Baseten API in a coding client, supply a Baseten key, choose an exact supported model slug, and use the client’s Baseten provider or the OpenAI-compatible base URL https://inference.baseten.co/v1. Baseten’s Model APIs overview (opens in a new tab) describes hosted models you can call without provisioning your own deployment. Keep the model choice and test results in fenbs, so a later session can continue from the evidence instead of guessing which settings worked.

What do you need before connecting?

Start with an account and API key that can access Model APIs, plus a compatible coding client. An API is a way for software to ask another service for a result; the coding client sends the request, while the hosted model produces the answer. Choosing a provider does not by itself establish which files the client may change.

Write down the task you want to test before entering credentials. For example, use a small demonstration repository and ask for a fix to an isolated formatting function. Keep real customer records and credentials out of the example. You want a request whose result you can judge without first understanding a large application.

If you are choosing between models rather than setting up this provider, start with the AI model guides and our guide to choosing AI models. The connection is only useful when the selected model handles your actual task well.

How do you configure a coding client?

Baseten’s coding-tool instructions (opens in a new tab) distinguish direct integrations from Baseten Switch. Use the route documented for your tool. For a direct connection in OpenCode, the documented sequence is short:

  1. Have your Baseten Model API key ready in the credential location your client uses. Do not put the key in a shared setup note.
  2. In OpenCode, enter /connect and select Baseten.
  3. Enter /models and choose a supported model.
  4. Send a small test prompt, then check the selected provider and model before asking for repository changes.

For an OpenAI-compatible application, configure the base URL above, its Baseten key, and the exact supported model slug from the overview. Do not paste an OpenAI key merely because the client uses an OpenAI-shaped request. Our OpenAI API guide covers OpenAI’s own service; it is a separate provider setup.

Baseten also documents Pi, Droid and Cline integrations. Claude Code and Codex CLI use a different route through Baseten Switch. Its beta requires macOS 13 or newer; do not treat it as a Windows installer or a way to configure Claude Desktop. Follow the dedicated instructions for the tool you actually use.

What should your first test prove?

Check the connection before checking ambitious coding work. Ask for a short answer with an unmistakable format, then move to a tiny coding task with an expected result. Record the prompt exactly, including any instructions that affect the output, so a future comparison uses the same question.

  • Connection: the request reaches the intended provider and selected model.
  • Correctness: the suggested change handles the example and its edge case.
  • Scope: the client changes only the files you allowed it to change.
  • Reporting: the assistant distinguishes a test it ran from one it merely suggested.

A hypothetical test could ask a function to format an empty list and a list with one entry. Save the expected answers before you run it. If one output looks good, repeat the check rather than treating one attractive explanation as proof. The guide to AI model evaluation explains the broader comparison process.

Why can a compatible request still fail?

Compatibility describes a request shape, not identical behavior across every model. Baseten’s overview warns that endpoint context and output limits can differ from a model’s advertised maximum, and that catalog metadata can differ from enforced limits. Start with the documented endpoint limits before sending a large codebase.

When a request fails, save the error and remove private request content before sharing it. Then check one variable at a time: provider, base URL, credential source, exact model slug, and request size. Randomly changing several settings can produce a working result without telling you what fixed the problem.

Billing and rate limits also apply. Use Baseten’s linked documentation for current limits instead of building your test around a remembered allowance. A short successful request is a better starting point for diagnosis than repeatedly resending a large failing task.

Does the API remember earlier conversation turns?

Baseten’s Responses reference (opens in a new tab) explicitly describes stateless requests: your application sends the full conversation in input each time. previous_response_id, conversation, background and prompt are rejected. Accepting store does not provide a response-retrieval endpoint.

A coding client may keep and resend its own conversation, but that is different from the provider remembering a session. Save your tested assumptions outside the conversation as well. A record in fenbs can tell the next assistant what you tried and what remains, while your application handles the actual request history.

Likewise, a stable routing or session-affinity identifier is not a saved explanation of your work. When comparing providers, use the same task record and fresh test inputs. Our AI model comparison guide covers that decision; packaging your own model belongs in the separate Baseten Truss guide.

How fenbs helps

Never lose the work you did in an AI session

After a useful AI session, save it in fenbs: the key observations, findings, research and context. Then carry on from exactly where you left off, on any device and in any other AI. The next AI you connect reads it at the start of the session, so you never have to explain the same problem again.

Create a free account

Free for up to 5 people and 50 open tasks · No credit card · Works with Claude, ChatGPT, Cursor and more

How to keep your API test results with fenbs

Keep enough to carry on from exactly where you left off, on any device and in any other AI. Save the result of the experiment, not the secret that allowed it to run.

  1. Create a free account.
  2. Add a task for the coding test and write what a good answer must do.
  3. Save the model name, test question, result and remaining problem. Leave out API keys and private code.
  4. Write the next step before you stop, so you or another assistant can pick up the same work.

fenbs keeps your research and experiment notes. It does not host the model, run the API call, or replace the coding client’s conversation storage. If all you need is one disposable connection check, a short local note may be enough.

Questions people ask.

Do I need my own deployment to try Model APIs?

No. Baseten describes Model APIs as hosted models you can call without first provisioning a dedicated deployment. Use the exact supported model slug for that service.

Can I reuse an OpenAI key with Baseten?

Use a Baseten key for a Baseten request. An OpenAI-compatible request format does not make credentials interchangeable between providers.

Will a session-affinity ID restore my conversation?

No. Session affinity concerns request routing and cache reuse. The Responses endpoint is stateless, so the application must supply the conversation needed for each request.

Does Baseten Switch support a Windows setup?

The documented Switch beta requires macOS 13 or newer. Direct Model API integrations are a separate route; follow the instructions for the coding tool you use.

Start with one thing.

Free for up to 5 people and 50 open tasks · No credit card · Works with Claude, ChatGPT, Cursor and more

There is nothing to set up first. Write one line and you’ve started.