Skip to content

Migrating from OpenAI

OpenAI's Assistants API is being shut down — here it continues: swap the base URL and key.

Updated on Aug 10, 2026

OpenAI has marked the Assistants API for permanent shutdown. If your application depends on assistants, threads, and runs, you don't need to rewrite it for another paradigm: HINOW maintains the same surface, actively. The migration is three changes — base URL, key, and model.

from openai import OpenAI
import os

client = OpenAI(
    api_key=os.environ["HINOW_API_KEY"],       # hi_...
    base_url="https://api.hinow.ai/v1",
)

assistant = client.beta.assistants.create(
    model="hinow/himax",
    name="Analista",
    instructions="Você é um analista objetivo.",
)

run = client.beta.threads.create_and_run_poll(
    assistant_id=assistant.id,
    thread={"messages": [{"role": "user", "content": "Qual a capital da França?"}]},
)
print(run.status)  # completed

What stays the same

  • Objects and fieldsassistant, thread, thread.message, thread.run, thread.run.step, file, vector_store, with the same field names and list envelopes (first_id, last_id, has_more).
  • Run statesqueuedin_progressrequires_actioncompleted / incomplete / failed / cancelled / expired.
  • Streaming eventsthread.run.*, thread.run.step.*, thread.message.*, done/[DONE].
  • Errors{"error": {"message", "type", "param", "code"}}.
  • Toolsfile_search, function (with requires_action/submit_tool_outputs) and the code_interpreter format.
  • Paginationlimit, order, after, before.

What to watch for

ThemeHere
ModelUse the HINOW catalog — hinow/himax is the recommendation. Model names used in old code are accepted as aliases and mapped to the catalog.
OpenAI-Beta headerUnnecessary; if the SDK sends it, it is ignored.
Concurrent runSecond run on the same thread → 400 invalid_request_error (at OpenAI the code varied between versions — handle by type).
Run timeout10 minutes, including wait in requires_action.
UploadUp to 25 MB per file.
List threadsGET /v1/threads exists here (extension) — OpenAI never offered it.
code_interpreterAccepted for compatibility; execution in development — see the Code Interpreter page.

Transparent billing

Each run charges only for the model calls it makes, on the same table as chat/completions — the run's usage (prompt, completion, and total tokens) shows exactly what was consumed.

Was this page helpful?