<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-switch-from-the-openai-api-to-digitalocean-s-serverless-inference-5iqqy8l8u" -->

---
title: How to Switch from the OpenAI API to DigitalOcean's...
description: DigitalOcean Serverless Inference offers OpenAI-compatible API endpoints, making migration from OpenAI straightforward for basic Chat Completions — just change...
canonical: https://daily.dev/posts/how-to-switch-from-the-openai-api-to-digitalocean-s-serverless-inference-5iqqy8l8u
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Switch from the OpenAI API to DigitalOcean's Serverless Inference | daily.dev
og:description: DigitalOcean Serverless Inference offers OpenAI-compatible API endpoints, making migration from OpenAI straightforward for basic Chat Completions — just change...
og:url: https://daily.dev/posts/how-to-switch-from-the-openai-api-to-digitalocean-s-serverless-inference-5iqqy8l8u
og:image: https://api.daily.dev/og/posts/5IqQY8L8U.png
og:image:alt: How to Switch from the OpenAI API to DigitalOcean's Serverless Inference
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Switch from the OpenAI API to DigitalOcean's Serverless Inference

**[DigitalOcean Community](https://daily.dev/sources/do_community)** · 8 min read · 1 upvotes · 0 comments

## Summary

DigitalOcean Serverless Inference offers OpenAI-compatible API endpoints, making migration from OpenAI straightforward for basic Chat Completions — just change the base URL, API credential, and model ID while keeping the OpenAI Python SDK. The guide covers supported endpoints (Chat Completions, Responses API, Embeddings, Image Generation, Batch Inference), unsupported ones (Assistants, Threads, Fine-tuning, Moderation), and key behavioral differences. Tool support varies by model and API surface, batch inference is asynchronous rather than real-time, and commercial models are tier-gated. It's a near drop-in for simple completions but not a full feature-parity replacement.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.digitalocean.com/community/tutorials/migrating-from-openai-api-to-do-serverless-inference>

## Questions this post answers

### What exactly do I need to change to switch my OpenAI Python SDK code to DigitalOcean Serverless Inference?

You need to change three things: the base_url to https://inference.do-ai.run/v1, the API key to a DigitalOcean model access key instead of your OpenAI key, and the model ID to a DigitalOcean catalog ID such as llama3.3-70b-instruct instead of gpt-4o. The client.chat.completions.create() method, bearer token auth scheme, and role-based message format all stay unchanged.

_daily.dev surfaces practical migration walkthroughs like this for developers switching LLM providers._

### Does DigitalOcean Serverless Inference support the OpenAI Assistants API or fine-tuning?

No. DigitalOcean Serverless Inference has no OpenAI-compatible equivalent for the Assistants API, Threads API, fine-tuning, or moderation endpoints — there is no /v1/assistants, /v1/threads, /v1/fine_tuning/jobs, or /v1/moderations endpoint. Conversation history is not stored server-side, so the calling application remains responsible for it. DigitalOcean offers a separate Agent Development Kit, but it is not a direct replacement for Assistants code.

_Developers evaluating LLM provider switches check compatibility gaps like this on daily.dev before migrating production workloads._

### How does batch inference work on DigitalOcean Serverless Inference compared to OpenAI's Batch API?

DigitalOcean's batch inference at /v1/batches is a separate asynchronous workflow, not a real-time endpoint, using the same base URL and model access key as real-time inference but running on its own rate limits. It accepts input files in either the native OpenAI Batch API or Anthropic Message Batches API JSONL format without converting between them, and supports only text prompts on commercial OpenAI and Anthropic models, excluding open-weight models, multimodal input, or image generation.

_Teams moving batch LLM jobs between providers reference specifics like these on daily.dev to avoid format mismatches._

## Similar posts on daily.dev

- [DigitalOcean Serverless Inference: A Deep Dive](https://daily.dev/posts/digitalocean-serverless-inference-a-deep-dive-xmvhq1yhq) · DigitalOcean · 0 upvotes · 0 comments
- [Best OpenAI-compatible inference APIs: drop-in alternatives for 2026](https://daily.dev/posts/best-openai-compatible-inference-apis-drop-in-alternatives-for-2026-vrtnzttyy) · DigitalOcean Community · 1 upvotes · 0 comments
- [Scalable, Cost-Efficient AI: Introducing Unified Batch Inference on DigitalOcean](https://daily.dev/posts/scalable-cost-efficient-ai-introducing-unified-batch-inference-on-digitalocean-g2kea1ifv) · DigitalOcean · 1 upvotes · 0 comments
- [Amazon SageMaker AI now supports OpenAI-compatible APIs for inference endpoints](https://daily.dev/posts/amazon-sagemaker-ai-now-supports-openai-compatible-apis-for-inference-endpoints-ypfblrowd) · AWS · 2 upvotes · 0 comments
- [Server-Side Tools Are Now Available for DigitalOcean Inference Engine](https://daily.dev/posts/server-side-tools-are-now-available-for-digitalocean-inference-engine-hbomex6do) · DigitalOcean · 0 upvotes · 0 comments

---

Tags: [#python](https://daily.dev/tags/python), [#llm](https://daily.dev/tags/llm), [#openai](https://daily.dev/tags/openai), [#digitalocean](https://daily.dev/tags/digitalocean)

[View this post on daily.dev](https://daily.dev/posts/how-to-switch-from-the-openai-api-to-digitalocean-s-serverless-inference-5iqqy8l8u)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Switch from the OpenAI API to DigitalOcean's Serverless Inference","url":"https://daily.dev/posts/how-to-switch-from-the-openai-api-to-digitalocean-s-serverless-inference-5iqqy8l8u","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-switch-from-the-openai-api-to-digitalocean-s-serverless-inference-5iqqy8l8u"},"datePublished":"2026-07-22T20:49:43.466Z","dateModified":"2026-09-14T06:39:44.175Z","description":"DigitalOcean Serverless Inference offers OpenAI-compatible API endpoints, making migration from OpenAI straightforward for basic Chat Completions — just change...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fafee921d7082dadb1668e129c1ef221?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/fafee921d7082dadb1668e129c1ef221?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"DigitalOcean Community","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"DigitalOcean Community","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/c1b9d07730e34ea388c39a498a753d6c","url":"https://daily.dev/sources/do_community"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-to-switch-from-the-openai-api-to-digitalocean-s-serverless-inference-5iqqy8l8u","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,llm,openai,digitalocean","timeRequired":"PT8M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"DigitalOcean Community","item":"https://daily.dev/sources/do_community"},{"@type":"ListItem","position":3,"name":"How to Switch from the OpenAI API to DigitalOcean's Serverless Inference"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-to-switch-from-the-openai-api-to-digitalocean-s-serverless-inference-5iqqy8l8u#faq","mainEntity":[{"@type":"Question","name":"What exactly do I need to change to switch my OpenAI Python SDK code to DigitalOcean Serverless Inference?","acceptedAnswer":{"@type":"Answer","text":"You need to change three things: the base_url to https://inference.do-ai.run/v1, the API key to a DigitalOcean model access key instead of your OpenAI key, and the model ID to a DigitalOcean catalog ID such as llama3.3-70b-instruct instead of gpt-4o. The client.chat.completions.create() method, bearer token auth scheme, and role-based message format all stay unchanged. daily.dev surfaces practical migration walkthroughs like this for developers switching LLM providers."}},{"@type":"Question","name":"Does DigitalOcean Serverless Inference support the OpenAI Assistants API or fine-tuning?","acceptedAnswer":{"@type":"Answer","text":"No. DigitalOcean Serverless Inference has no OpenAI-compatible equivalent for the Assistants API, Threads API, fine-tuning, or moderation endpoints — there is no /v1/assistants, /v1/threads, /v1/fine_tuning/jobs, or /v1/moderations endpoint. Conversation history is not stored server-side, so the calling application remains responsible for it. DigitalOcean offers a separate Agent Development Kit, but it is not a direct replacement for Assistants code. Developers evaluating LLM provider switches check compatibility gaps like this on daily.dev before migrating production workloads."}},{"@type":"Question","name":"How does batch inference work on DigitalOcean Serverless Inference compared to OpenAI's Batch API?","acceptedAnswer":{"@type":"Answer","text":"DigitalOcean's batch inference at /v1/batches is a separate asynchronous workflow, not a real-time endpoint, using the same base URL and model access key as real-time inference but running on its own rate limits. It accepts input files in either the native OpenAI Batch API or Anthropic Message Batches API JSONL format without converting between them, and supports only text prompts on commercial OpenAI and Anthropic models, excluding open-weight models, multimodal input, or image generation. Teams moving batch LLM jobs between providers reference specifics like these on daily.dev to avoid format mismatches."}}]}
```

