API
Keys, endpoints, and examples.
RedModel connectedredmodel OPENAI-COMPATIBLE
API keys
Manage access to the model.
Loading your workspace…
Keys belong to your account. 0/10 keys created.
Keep your keys private and use them from a server.
Your API base URL
Loading endpoint…Set your client’s base URL to this endpoint and use redmodel as the model ID. Both streaming and standard responses are supported.
Quickstart
OpenAI-compatible.
from openai import OpenAI
import os
client = OpenAI(
api_key=os.environ["REDMODEL_API_KEY"],
base_url="http://localhost:3000/v1"
)
response = client.chat.completions.create(
model="redmodel",
messages=[{
"role": "user",
"content": "Challenge my assumptions."
}]
)
print(response.choices[0].message.content)pip install openai
Reference
POST/v1/chat/completions
Send a conversation and receive the model’s next response. Authenticate with Authorization: Bearer YOUR_REDMODEL_API_KEY and send a JSON body.
| Parameter | Type | Description |
|---|---|---|
model | string | Use redmodel. |
messages | array | Messages with role and content. End with a user message. |
stream | boolean | Set true for server-sent events. Default: false. |
max_tokens | integer | Optional output limit passed to the model provider. |
GET/v1/models
List the available model IDs. Use the same Bearer token as your chat requests. The response follows the OpenAI models-list format.
INFOLimits & response codes
Each key supports up to 60 requests per minute in this prototype. A
429 response includes a Retry-After header. Invalid or missing keys return 401; malformed requests return 400. The demo returns simulated content, so it is intended for integration testing.