Skip to content
Last updated

Get your first AI response in under 5 minutes.

1. Get an API key

Sign in to Freddy, go to Settings → API Keys, and create a key. Your key starts with ak_.

2. Make your first request

from aitronos import Aitronos

client = Aitronos(api_key="your-api-key")

result = client.responses.create_response(
    organization_id="org_your_org_id",
    model="gpt-4o",
    inputs=[{"role": "user", "content": "Hello, world!"}],
)

print(result.response[0]["text"])

Install the SDK: pip install aitronos-sdk

3. Response structure

{
  "success": true,
  "thread_id": "thrd_abc123",
  "response_id": "msg_abc123",
  "response": [
    {
      "type": "text",
      "text": "Hello! How can I help you today?"
    }
  ],
  "stop_reason": "end_turn",
  "usage": {
    "input_tokens": 10,
    "output_tokens": 9
  }
}

The response array contains one or more content blocks. For plain text responses, read response[0]["text"].

4. Keep conversation context with threads

Pass a thread_id to maintain conversation state across requests. Threads are created automatically on first use — pass the thread_id returned in the response to continue the conversation.

from aitronos import Aitronos

client = Aitronos(api_key="your-api-key")

# First message — no thread_id, one gets created
first = client.responses.create_response(
    organization_id="org_your_org_id",
    model="gpt-4o",
    inputs=[{"role": "user", "content": "My name is Alice."}],
)
thread_id = first.thread_id

# Follow-up message — pass the thread_id
second = client.responses.create_response(
    organization_id="org_your_org_id",
    model="gpt-4o",
    thread_id=thread_id,
    inputs=[{"role": "user", "content": "What is my name?"}],
)
print(second.response[0]["text"])  # "Your name is Alice."

5. Use an assistant

Assistants add persistent instructions, a default model, and optional file context to every conversation:

result = client.responses.create_response(
    organization_id="org_your_org_id",
    assistant_id="asst_your_assistant_id",
    inputs=[{"role": "user", "content": "Summarize our return policy."}],
)
print(result.response[0]["text"])

Next steps