Superinterface
Product
Pricing
Examples
Docs
Blog
GitHub
Discord
Book a demo
Sign in
Menu
Getting started
AI Provider Setup
FAQ
Assistants
Create assistant
Functions
Interfaces
Create interface
Interaction Modes
AI Builder
Publish interface
Components
Annotations
Concepts
Why Superinterface
How it works
Tasks
Overview
API reference
React
Installation
Components
Hooks
Contexts
Utils
Server
messagesResponse
createMessageResponse
extendMessage
JavaScript
REST
messagesResponse
Fetch a page of messages for a given thread.
import
OpenAI
from
'
openai
'
import
{
messagesResponse
}
from
'
@superinterface/react/server
'
const
client
=
new
OpenAI
(
{
apiKey
:
process
.
env
.
OPENAI_API_KEY
}
)
const
page
=
await
messagesResponse
(
{
client
,
threadId
:
'
thd_123
'
}
)
Arguments
Parameter
Type
Required
Description
client
OpenAI
Yes
OpenAI client instance
threadId
string
Yes
ID of the thread to fetch
pageParam
string
No
Pagination cursor
Returns
A
MessagesPage
containing message data and pagination info.
Status
Changelog
Terms of service
Privacy policy