Skip to main content

1. Create an Account

Sign up on the platform and generate an API key from your dashboard.

2. Try the Playground

Before writing code, try the Playground to test prompts interactively.

3. Install an SDK

Subconscious is compatible with both the OpenAI and Anthropic SDKs — use whichever you prefer. Install it for your language:
pip install openai

4. Make Your First Request

Set your API key and base URL, then create a chat completion:
from openai import OpenAI

client = OpenAI(
    api_key="your-api-key",
    base_url="https://api.subconscious.dev/v1",
)

response = client.chat.completions.create(
    model="subconscious/tim-qwen3.6-27b",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain quantum computing in three sentences."},
    ],
)

print(response.choices[0].message.content)

Using an agents SDK

Want to use an SDK build for handling agents? Try one of these:
from openai import AsyncOpenAI
from agents import (
    Agent,
    Runner,
    OpenAIChatCompletionsModel,
    set_tracing_disabled,
)

API_KEY = "your-api-key"
MODEL = "subconscious/tim-qwen3.6-27b"


def run_openai_agent():
    client = AsyncOpenAI(
        api_key=API_KEY,
        base_url="https://api.subconscious.dev/v1",
    )
    # Tracing would otherwise try to reach OpenAI's backend.
    set_tracing_disabled(True)

    # Pass an explicit Chat Completions model bound to our client. A bare
    # model string would route through the MultiProvider, which treats the
    # "subconscious/" segment as a provider prefix and fails.
    agent = Agent(
        name="Assistant",
        instructions="You are a helpful assistant.",
        model=OpenAIChatCompletionsModel(model=MODEL, openai_client=client),
    )
    result = Runner.run_sync(agent, "What is the capital of France?")
    print("OpenAI Agents SDK response:")
    print(result.final_output)


run_openai_agent()

5. Try Streaming

You can stream responses token by token for real-time output:
stream = client.chat.completions.create(
    model="subconscious/tim-qwen3.6-27b",
    messages=[{"role": "user", "content": "Write a haiku about programming."}],
    stream=True,
)

for chunk in stream:
    content = chunk.choices[0].delta.content
    if content:
        print(content, end="", flush=True)
See Streaming for more details.

6. Try Structured Output

You can also get typed JSON responses by providing a schema:
response = client.chat.completions.create(
    model="subconscious/tim-qwen3.6-27b",
    messages=[{"role": "user", "content": "Analyze the sentiment of: 'I love this product!'"}],
    response_format={
        "type": "json_schema",
        "json_schema": {
            "name": "sentiment_analysis",
            "schema": {
                "type": "object",
                "properties": {
                    "sentiment": {"type": "string", "enum": ["positive", "negative", "neutral"]},
                    "confidence": {"type": "number"},
                },
                "required": ["sentiment", "confidence"],
            },
        },
    },
)

import json
result = json.loads(response.choices[0].message.content)
print(result)  # {"sentiment": "positive", "confidence": 0.95}
See Structured Output for more details.

Next Steps

Streaming

Real-time token-by-token output

Structured Output

Typed JSON responses with schemas

Thinking Mode

Enable step-by-step reasoning

API Reference

Full endpoint documentation