DeProcess Try the API

Switch an OpenAI-Compatible API by Changing the Base URL

Published · Updated · By Sydney Kibuuka, Founder · 6 min read

Cover: Switch an OpenAI-Compatible API by Changing the Base URL. Key points: 1. Python: base_url. JavaScript: baseURL; 2. DePro base URL: https://api.deprocess.ai/v1; 3. Send long recordings as async jobs over HTTP.

To switch an OpenAI-compatible API, keep your code and the official OpenAI SDK, and change two settings when you create the client: the base URL and the API key. In Python that is OpenAI(base_url="https://api.deprocess.ai/v1", api_key="dpc_your_key"); in JavaScript it is new OpenAI({ baseURL: "https://api.deprocess.ai/v1", apiKey: "dpc_your_key" }). Then check what the new provider supports, because "compatible" covers the request format, not every feature or model name.

Key takeaways

  • The Python SDK's option is base_url and the JavaScript SDK's is baseURL; both also read the OPENAI_BASE_URL and OPENAI_API_KEY environment variables.
  • The DePro API base URL is https://api.deprocess.ai/v1 and keys start with dpc_, sent as a bearer token.
  • DeProcess offers speech to text, embeddings and chat in OpenAI's formats; chat streaming isn't supported yet and other OpenAI endpoints aren't available.
  • The SDKs need a model name: the DePro docs use "whisper" for speech to text and "default" for embeddings and chat.
  • Long jobs can come back as 202 with a job id, which the SDKs don't wait for, so send long recordings with plain HTTP and async.

How do you switch an OpenAI-compatible API by changing the base URL?

You pass a different base URL and API key when you create the client, and keep every other line. The official OpenAI SDKs send each request to the base URL plus the endpoint path, so a client pointed at https://api.deprocess.ai/v1 sends embeddings to https://api.deprocess.ai/v1/embeddings instead of OpenAI's servers.

An OpenAI-compatible API is one that accepts the same request bodies and returns the same response shapes as OpenAI's API. The DePro API follows OpenAI's formats for speech to text, embeddings and chat, so most code moves over with the two changes below. The DePro API docs put it the same way: change the base URL and the key, nothing else.

What are the exact two lines in Python and JavaScript?

These are the client lines from the DePro quick start. Install the SDK first: pip install openai for Python or npm install openai for JavaScript, as OpenAI's libraries page shows.

Python (the option is base_url):

JavaScript or TypeScript (the option is baseURL):

Note the spelling: Python uses snake case (base_url, api_key) and JavaScript uses camel case (baseURL, apiKey). Mixing them up is the most common reason a switched client still calls the old address.

Replace dpc_your_key with the key from your console on the developer page. DePro keys start with dpc_ and go in an Authorization: Bearer header on every request; the SDK adds that header for you.

Can you switch without touching the code at all?

Yes, with environment variables. The Python SDK's README documents the OPENAI_BASE_URL variable as an alternative to the base_url argument, and both SDKs read the key from OPENAI_API_KEY. We tested both variables on November 10, 2026 with openai 3.39.0 for Python and openai 7.45.1 for JavaScript: a client created with no arguments used the address and key from the environment.

This is handy for staging and production setups, or for trying a second provider without a code change. An explicit argument in code wins over the variable, so search your code for base_url or baseURL if the variable seems to be ignored.

What does a full request look like after the switch?

The calls stay the same as with OpenAI. These examples follow the DePro docs, written one statement per line:

Speech to text, short file (Python):

Embeddings (JavaScript):

Chat (Python):

We ran each of these with both SDKs against a local test server that answers in the DePro response formats, and checked that the paths, the bearer header and the fields arrived as the docs describe. Against https://api.deprocess.ai/v1 with a made-up key, every endpoint answered with a JSON 401 error, which shows the paths exist and the key check comes first.

What does "compatible" not cover?

Compatible means the request and response formats match. It does not mean every OpenAI feature or model exists. Check these before you switch production traffic:

AreaWith DeProcess
EndpointsSpeech to text, embeddings, chat, job status and job deletion. Other OpenAI endpoints aren't available.
Model namesRequired by the SDKs. Use "whisper" for speech to text and "default" for embeddings and chat; DePro uses the network's open-source model unless you name another one that's online.
StreamingChat streaming isn't supported yet. Don't pass stream=True.
Long jobsRequests that run longer than about 50 seconds return 202 with a job id instead of the result.
Extra fieldsSpeech to text also takes url, async and webhook_url, which are DePro additions.
ErrorsErrors come back as {"error": {"message": "…"}} with standard status codes (400, 401, 402, 404, 410, 413).

The model point matters most. Prompts tuned for one model can behave differently on an open-source model, and embeddings from different models can't be mixed in one search index. If you move embeddings, plan to re-embed your documents with the new provider rather than querying old vectors with new ones.

How do you handle long jobs and retries with an SDK?

Use the SDK for short work and plain HTTP for long work. The SDKs expect the finished result in the response. When a DePro request takes longer than about 50 seconds, the API answers 202 with a job id so your code never hangs, but the SDK doesn't know to poll that id. In our test, the Python SDK raised an error when an embeddings call came back as 202 without data.

For recordings longer than a minute or two, the DePro docs send a url with "async": true and a webhook_url using a plain HTTP request, then collect the result by webhook or with GET /v1/jobs/{id}. The guide on transcribing long audio files with an API walks through that flow, and the overview of how batch speech to text works explains why long recordings are queued.

Retries are the other thing to know. Both SDK READMEs say certain errors (connection errors, 408, 409, 429 and 5xx) are retried 2 times by default with a short backoff, and that requests time out after 10 minutes by default. You can change these with max_retries and timeout in Python or maxRetries and timeout in JavaScript. With DeProcess, a failed job isn't charged, so a retry after a failure doesn't double-bill you.

How do you run two providers side by side?

Create one client per provider. Nothing in the SDK ties you to a single base URL, so an app can keep OpenAI for live chat and send batch work elsewhere:

This is also the safest way to migrate: move one job type at a time, compare results on real data and keep the old client as a fallback. For large offline jobs, the comparison of OpenAI Batch API alternatives shows which batch services accept OpenAI's file format.

When should you not switch?

Stay with your current provider for anything DeProcess doesn't do: live voice, streaming chat or features outside the endpoints listed in the DePro docs. DeProcess is a batch lane. It is a good fit when the work can wait in a queue (transcription backlogs, document embedding, bulk summaries) and price matters more than an instant answer. Pricing is listed on the docs pricing table, and new accounts start with $0.50 of free credit, enough to test the switch on your own data.

Frequently asked questions

Do I have to rewrite my code to leave OpenAI's API?

Usually not. If the new provider follows OpenAI's request and response formats, you change the base URL and the key and keep the rest. Test each endpoint you use, because providers support different subsets.

Can I keep OpenAI and another provider in the same app?

Yes. Create two clients, each with its own base URL and key, and choose one per task. For example, one client for live chat and another for batch transcription.

Which model name do I send to DeProcess?

The SDKs require one. The DePro docs use "whisper" for speech to text and "default" for embeddings and chat; DePro uses the network's open-source model unless you name another one that is online.

Does the switch work with LangChain or other tools built on the OpenAI SDK?

Tools that let you set a base URL or pass your own OpenAI client usually work the same way, but check that tool's own documentation for the option name.

Sources

  1. OpenAI: openai-python README (client options, OPENAI_BASE_URL, retries, timeouts)
  2. OpenAI: openai-node README (retries, timeouts, baseURL)
  3. OpenAI: Libraries and SDKs
  4. DeProcess: API docs (base URL, authentication, endpoints, errors)

Have recordings to transcribe?

Test DeProcess on your own audio. Ask for a free 10-hour test, or start with the free credit every new account gets. Same API format as OpenAI.

Start a free test

Have a computer that sits idle?

Install the DePro app and your computer works on AI jobs while you’re away. Free to join, about five minutes to set up.

Join with your computer

Related guides

About this guide

Last reviewed . Written by Sydney Kibuuka, Founder, researched and drafted with AI and checked by automated quality checks before it was published. Facts about other companies come from their own published pages, with dates. Read our editorial standards; spotted a mistake? Tell us and we’ll fix it (see corrections).