API documentation for crofAI
CrofAI supports the OpenAI SDK for LLM inference. Below will be a python example.
from openai import OpenAI
client = OpenAI(
base_url="https://ai.nahcrof.com/v2",
api_key="api-key-here"
)
response = client.chat.completions.create(
model="MODEL-FROM-LIST",
messages=[
{"role": "user", "content": "Hello!"}
]
)
print(response.choices[0].message.content)from openai import OpenAI
client = OpenAI(
base_url="https://ai.nahcrof.com/v2",
api_key="api-key-here"
)
response = client.chat.completions.create(
model="MODEL-FROM-LIST",
messages=[
{"role": "user", "content": "Howdy there! How are you?"}
],
stream=True # Enable streaming
)
for chunk in response:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)base_url: https://ai.nahcrof.com/v2
OR
base_url: https://ai.nahcrof.com/v1 (available for tools that don't support /v2)
EXAMPLE
https://ai.nahcrof.com/v2/chat/completions
https://ai.nahcrof.com/v1/chat/completions
base_url: https://anthropic.nahcrof.com
EXAMPLE
https://anthropic.nahcrof.com/v1/messages
- max_tokens
- temperature
- top_p
- stop
- seed
- tools
These are available on the /pricing page
By default, CrofAI does not serve 429 error codes because we do not intend on rate limiting users. However, in the event that a user is registered as a likely bot account (this is unrelated to the amount of usage you handle) your account will only receive 429 error codes. If this is happening to you, contact support and we will unblock your account