Get Started
To get started, sign up for our platform and create your account. You’ll need platform access and an API key to continue.
Try the Playground
For an immediate taste of our platforms’s capabilities, try the playground. The playground provides a user-friendly interface where you can test prompts and tools with our inference engine and see results without writing any code.
The Subconscious Playground: A quick easy way to get started!
Official SDKs
We provide official SDKs for seamless integration:
Create Your API Key
First, create an API key from your dashboard. Important: API keys are only shown once for security reasons. If you’ve lost your API key, simply create a new one from the “API Keys” tab.
Using the SDKs
Our SDKs provide the simplest way to interact with Subconscious. Create a run, wait for completion, and get your results.
import { Subconscious } from 'subconscious';
const client = new Subconscious({
apiKey: process.env.SUBCONSCIOUS_API_KEY!,
});
const run = await client.run({
engine: 'tim-large',
input: {
instructions: 'Search for the latest AI news and summarize the top 3 stories',
tools: [{ type: 'platform', id: 'parallel_search', options: {} }],
},
options: { awaitCompletion: true },
});
console.log(run.result?.answer);
from subconscious import Subconscious
client = Subconscious(api_key="your-api-key")
run = client.run(
engine="tim-large",
input={
"instructions": "Search for the latest AI news and summarize the top 3 stories",
"tools": [{"type": "platform", "id": "parallel_search"}],
},
options={"await_completion": True},
)
print(run.result.answer)
Streaming
Stream text as it’s generated for real-time output:
const stream = client.stream({
engine: 'tim-large',
input: {
instructions: 'Write a short essay about space exploration',
tools: [{ type: 'platform', id: 'parallel_search' }],
},
});
for await (const event of stream) {
if (event.type === 'delta') {
process.stdout.write(event.content);
} else if (event.type === 'done') {
console.log('\n\nRun completed:', event.runId);
}
}
for event in client.stream(
engine="tim-large",
input={
"instructions": "Write a short essay about space exploration",
"tools": [{"type": "platform", "id": "parallel_search"}],
},
):
if event.type == "delta":
print(event.content, end="", flush=True)
elif event.type == "done":
print(f"\n\nRun completed: {event.run_id}")
Fire and Forget
Start a run without waiting, then check status later:
const run = await client.run({
engine: 'tim-large',
input: {
instructions: 'Generate a comprehensive report',
tools: [],
},
});
console.log(`Run started: ${run.runId}`);
// Check status later
const status = await client.get(run.runId);
console.log(status.status); // 'queued' | 'running' | 'succeeded' | 'failed'
run = client.run(
engine="tim-large",
input={
"instructions": "Generate a comprehensive report",
"tools": [],
},
)
print(f"Run started: {run.run_id}")
# Check status later
status = client.get(run.run_id)
print(status.status) # 'queued' | 'running' | 'succeeded' | 'failed'
OpenAI-Compatible API
Our API is also compatible with the OpenAI format, so you can use existing OpenAI libraries.
from openai import OpenAI
client = OpenAI(
base_url="https://api.subconscious.dev/v1",
api_key="YOUR_API_KEY"
)
response = client.chat.completions.create(
model="tim-small-preview",
messages=[
{"role": "user", "content": "What's the derivative of 3x^2 * sin(x)?"}
],
stream=True
)
for chunk in response:
print(chunk.choices[0].delta.content or "", end="")
import OpenAI from 'openai';
const openai = new OpenAI({
baseURL: 'https://api.subconscious.dev/v1',
apiKey: 'YOUR_API_KEY'
});
const response = await openai.chat.completions.create({
model: 'tim-small-preview',
messages: [
{ role: 'user', content: "What's the derivative of 3x^2 * sin(x)" }
],
stream: true
});
for await (const chunk of response) {
process.stdout.write(chunk.choices[0]?.delta?.content || "");
}
curl https://api.subconscious.dev/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "tim-small-preview",
"stream": true,
"messages": [
{
"role": "user",
"content": "What is the derivative of 3x^2 * sin(x)"
}
]
}'
TIM models currently require stream=True for synchronous chat completions when using the OpenAI-compatible API.
That’s it! You’re now ready to start building with Subconscious.