-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
discussionUsed for feature requests, proposals, ideas, etc. Open discussionUsed for feature requests, proposals, ideas, etc. Open discussion
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
I'd like to request the addition of a new API endpoint /v1/responses specifically tailored for xAI providers (e.g., integrating with Grok or other xAI models). This endpoint would allow developers to generate and retrieve responses from xAI models in a standardized way, similar to existing endpoints like /v1/chat/completions but optimized for xAI's unique capabilities.
What do I want to change or add?
Currently, xAI integrations might rely on custom wrappers or indirect calls to existing OpenAI-compatible endpoints, which can lead to inconsistencies or limitations when leveraging xAI-specific features. Adding /v1/responses would provide a dedicated, provider-specific path that supports:
- Request Format: JSON payload similar to chat completions, e.g.:
{
"input": [
{
"role": "system",
"content": "You are a helpful assistant that can answer questions and help with tasks."
},
{
"role": "user",
"content": "What is 101*3?"
}
],
"model": "grok-4-0709"
}- Response Format: Standardized JSON with fields like
id,object("response"),created,model,choices(array withmessagecontainingroleandcontent), andusage(prompt/completion tokens). For streaming, it would use Server-Sent Events (SSE). - Authentication: API key-based, with rate limiting aligned to xAI tiers (e.g., 10k RPM for free tier).
Benefits of implementing this:
- Easier Integration: Developers building multi-provider apps (e.g., using LangChain or Vercel AI SDK) could seamlessly switch to xAI without refactoring code, promoting xAI adoption.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
discussionUsed for feature requests, proposals, ideas, etc. Open discussionUsed for feature requests, proposals, ideas, etc. Open discussion