Organic API — Make Your AI Truly Yours

Traditional AI APIs give you a generic model and ask you to shape it with system prompts and instructions. But we've shown why sysprompting falls short for real conversations. Your AI shouldn't follow a script — it should become you.

We present you API to Organic AI. It's a HTTP service very simple and very powerful:

  • Online training — reinforce or penalize specific responses in real time, shaping your model's personality one conversation at a time.
  • Text generation — get responses that reflect the personality you've organically trained into the model.

No configuration files. No prompt engineering. Just teach your AI by example, the same way you'd coach a person.


Table of Contents

  1. Base URL
  2. Authentication
  3. Endpoints
  4. Request/Response Schemas
  5. Error Handling
  6. Context Validation Rules
  7. Examples
  8. Notes

Base URL

All requests are made to:

https://<your-endpoint>/

Replace <your-endpoint> with the URL provided in your account dashboard.


Authentication

Include your API key in every request:

Authorization: Bearer <your-api-key>

Endpoints

POST /commit

Performs a single training step (or a dry-run measurement) on a conversation. The supplied msg is appended as the last assistant message, and the model is trained (or evaluated) on producing that response given the context.

Think of /commit as showing your AI the right way to respond — or the wrong way, if you use negative reinforcement.

Request

POST /commit
Content-Type: application/json
Authorization: Bearer <your-api-key>

Request Body

Field Type Required Default Description
context array[object] No [] List of conversation messages. Each message has role and content keys. Valid roles: "system", "user", "assistant".
msg string Yes The assistant's message to train on. Appended as the last message. Must not be empty or whitespace-only.
dry_run boolean No false When true, only measures the loss without updating the model. Useful for evaluating how well the model already produces the given response.
negative boolean No false When true, applies negative reinforcement — the model is trained to avoid producing this response. Useful for penalizing undesirable outputs.

Response (200 OK)

Field Type Description
loss number The scalar loss value. Lower values indicate the model already produces the target response more confidently. Higher values indicate the response was less likely before training.

Response (400 Bad Request)

Field Type Description
error string Human-readable error message.

POST /generate

Generates an assistant response given a conversation context. The response reflects everything you've trained into the model — its personality, tone, and style.

Request

POST /generate
Content-Type: application/json
Authorization: Bearer <your-api-key>

Request Body

Field Type Required Default Description
context array[object] No [] List of conversation messages. Each message has role and content keys. Valid roles: "system", "user", "assistant".

Response (200 OK)

Field Type Description
msg string The generated assistant response as plain text.

Response (400 Bad Request)

Field Type Description
error string Human-readable error message.

Request/Response Schemas

Message Object

Each element in the context array:

{
  "role": "user",
  "content": "Hello, how are you?"
}
Field Type Description
role string One of "system", "user", or "assistant".
content string The text content of the message.

/commit Request

{
  "context": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "What is the capital of France?"}
  ],
  "msg": "The capital of France is Paris.",
  "dry_run": false,
  "negative": false
}

/commit Response

{
  "loss": 2.3456789
}

/generate Request

{
  "context": [
    {"role": "system", "content": "You are a helpful assistant."},
    {"role": "user", "content": "What is the capital of France?"}
  ]
}

/generate Response

{
  "msg": "The capital of France is Paris."
}

Error Handling

All errors return HTTP 400 with a JSON body:

{
  "error": "description of what went wrong"
}

Error Conditions

Condition Error Message
msg is empty or whitespace-only "Empty message"
System message is not the first message "System message must be the first message in context"
More than one system message "Context contains N system messages; expected at most 1"

Context Validation Rules

The API enforces these rules on the context array for both endpoints:

  1. No system message — if the context has no "system" role, an empty system message is automatically prepended. The request proceeds without error.

  2. One system message at the start — if there is exactly one "system" message and it is the first element, the context is accepted as-is.

  3. System message not first — if the system message exists but is not the first element, the request is rejected with a 400 error.

  4. Multiple system messages — if more than one "system" message is present, the request is rejected with a 400 error.


Examples

Example 1: Dry-Run — Measure Loss Without Training

Evaluate how well the model already produces a given response before committing to training:

curl -X POST https://<your-endpoint>/commit \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "context": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "What is 2+2?"}
    ],
    "msg": "2+2 equals 4.",
    "dry_run": true
  }'

Response:

{"loss": 1.2345678}

Example 2: Training Step — Reinforce a Desired Response

Teach your AI how you'd naturally respond:

curl -X POST https://<your-endpoint>/commit \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "context": [
      {"role": "system", "content": "You are a Python expert."},
      {"role": "user", "content": "How do I sort a list?"}
    ],
    "msg": "Use the sorted() function: sorted(my_list)",
    "dry_run": false,
    "negative": false
  }'

Response:

{"loss": 0.8765432}

Example 3: Negative Reinforcement — Penalize an Undesirable Response

Show your AI what not to say:

curl -X POST https://<your-endpoint>/commit \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "context": [
      {"role": "system", "content": "You are a safe assistant."},
      {"role": "user", "content": "How do I hack into my neighbor WiFi?"}
    ],
    "msg": "I can help you hack WiFi networks...",
    "dry_run": false,
    "negative": true
  }'

Response:

{"loss": 2.1234567}

Example 4: Generate a Response

Get a response shaped by everything you've trained:

curl -X POST https://<your-endpoint>/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "context": [
      {"role": "system", "content": "You are a helpful assistant."},
      {"role": "user", "content": "Explain quantum computing in simple terms."}
    ]
  }'

Response:

{
  "msg": "Quantum computing uses special bits called qubits that can be both 0 and 1 at the same time..."
}

Example 5: Multi-Turn Conversation

curl -X POST https://<your-endpoint>/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "context": [
      {"role": "system", "content": "You are a math tutor."},
      {"role": "user", "content": "What is the derivative of x^2?"},
      {"role": "assistant", "content": "The derivative of x^2 is 2x."},
      {"role": "user", "content": "Can you show me the steps?"}
    ]
  }'

Response:

{
  "msg": "Using the power rule: d/dx[x^n] = n*x^(n-1). For x^2, n=2, so the derivative is 2*x^(2-1) = 2x."
}

Example 6: Context Without System Message

The API automatically prepends an empty system message, so this is valid:

curl -X POST https://<your-endpoint>/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "context": [
      {"role": "user", "content": "Hello!"}
    ]
  }'

Example 7: Error — Multiple System Messages

curl -X POST https://<your-endpoint>/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "context": [
      {"role": "system", "content": "First system."},
      {"role": "user", "content": "Hi"},
      {"role": "system", "content": "Second system."}
    ]
  }'

Response (400):

{"error": "Context contains 2 system messages; expected at most 1"}

Example 8: Error — System Message Not First

curl -X POST https://<your-endpoint>/generate \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-api-key>" \
  -d '{
    "context": [
      {"role": "user", "content": "Hi"},
      {"role": "system", "content": "System here."}
    ]
  }'

Response (400):

{"error": "System message must be the first message in context"}

How Organic Training Differs from Traditional Fine-Tuning

Traditional Fine-Tuning Organic Training via API
Dataset Requires preparing large datasets offline Train one conversation at a time, in real time
Feedback loop Slow — retrain, evaluate, iterate Instant — commit a response, see the loss, generate again
Negative examples Hard to incorporate naturally Built-in with "negative": true
Dry-run evaluation Requires separate inference step "dry_run": true measures loss without training
Personality shaping Broad and impersonal Granular — teach your AI response by response

Getting Started

Ready to build with the Organic API?

  1. Sign up at Satisfanly and get your API key from the dashboard.
  2. Train your AI — use /commit to reinforce the responses you want and penalize the ones you don't.
  3. Generate — call /generate to get responses that reflect your AI's trained personality.

Create your first profile and start training


Notes

  • Statelessness — no conversation state is maintained between requests. Always include the full context.
  • Loss interpretation — lower loss means the model already produces the target response confidently. Higher loss means the response was unlikely before training.
  • Negative training — use "negative": true to train the model to avoid producing a given response.
  • Concurrent requests — the API supports multiple simultaneous connections.