Skip to content

Messages

Appends messages to the thread — the history stays on the server.

Updated on Aug 10, 2026

The thread is the conversation. Each new message is a POST — and that is all you send: the previous history is already there, stored by the platform.

POSThttps://api.hinow.ai/v1/threadsBearer

Appends a message to the conversation.

Parâmetros

  • messagesarray· body

    `user` or `assistant`.

  • tool_resourcesobject· body

    Message appended

  • metadataobject· body

Respostas

200O objeto thread
POSThttps://api.hinow.ai/v1/threads/{thread_id}/messagesBearer

Acrescenta uma mensagem à conversa.

Parâmetros

  • thread_idstring· pathobrigatório
  • rolestring· bodyobrigatório

    user ou assistant.

  • contentstring | array· bodyobrigatório

    Texto simples ou blocos de conteúdo (text, image_url).

  • attachmentsarray· body

    Arquivos anexados à mensagem.

  • metadataobject· body

Respostas

200O objeto thread.message
400role inválida (aceita apenas user e assistant)

Ler o histórico

A listagem segue a paginação por cursor da OpenAI: limit (até 100), order (asc|desc), after e before recebendo um id de mensagem. O filtro run_id devolve só o que uma execução específica produziu.

# a resposta mais recente
curl -s "https://api.hinow.ai/v1/threads/thread_.../messages?order=desc&limit=1" \
  -H "Authorization: Bearer hi_SUA_API_KEY"

# só as mensagens geradas por um run
curl -s "https://api.hinow.ai/v1/threads/thread_.../messages?run_id=run_..." \
  -H "Authorization: Bearer hi_SUA_API_KEY"

Mensagens do assistente chegam com role: "assistant", run_id e assistant_id preenchidos, e o texto em content[0].text.value.

Gerenciar

# ler
curl -s https://api.hinow.ai/v1/threads/thread_... -H "Authorization: Bearer hi_SUA_API_KEY"

# editar metadata / tool_resources
curl -s https://api.hinow.ai/v1/threads/thread_... \
  -H "Authorization: Bearer hi_SUA_API_KEY" -H "Content-Type: application/json" \
  -d '{"metadata": {"cliente": "acme"}}'

# remover (leva as mensagens junto)
curl -s -X DELETE https://api.hinow.ai/v1/threads/thread_... -H "Authorization: Bearer hi_SUA_API_KEY"

Extensão HINOW: listar threads

A OpenAI nunca ofereceu GET /v1/threads — aqui existe, com a mesma paginação dos demais recursos. Útil para reconstruir a lista de conversas de um usuário sem manter um índice paralelo.

Was this page helpful?