Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic instructions for using xAI Grok. #655

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pieterza
Copy link

I wanted to see if xAI's grok is supported, but could not find any existing docs/pull-requests/issues/discussions or instructions.

https://x.ai/blog/api

API
To learn more about our API, check out our documentation at [docs.x.ai](https://docs.x.ai/). Our REST API is fully compatible with the ones offered by OpenAI and Anthropic. This simplifies migration. For example, if you’re currently using the OpenAI Python SDK, you can start using Grok by simply changing the base_url to https://api.x.ai/v1 and using your xAI API key that you created on [console.x.ai](https://console.x.ai/).
The xAI API is 

As such I've figured out how to make it work and this PR adds instructions accordingly:

export OPENAI_API_KEY='xai-xxxx'
export DEFAULT_MODEL="grok-beta" #Or whatever model is listed at the time, and preferred.
export API_BASE_URL=https://api.x.ai/v1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants