• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
subconscious_ajaya

subconscious_ajaya

subconscious-getting-started

Let's get you up and running your first Val with Subconscious.
Public
Like
1
subconscious-getting-started
Home
Code
5
01_script.ts
H
02_http.ts
C
03_cron.ts
E
04_email.ts
README.md
Environment variables
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
README.md
Code
/
README.md
Search
…
Viewing readonly version of main branch: v11
View latest version
README.md

Getting Started with the Subconscious API 🧠

Learn how to use the Subconscious AI agent API on Val Town.

Setup

  1. Get an API key from the Subconscious dashboard
  2. Add it as an environment variable in this val's settings: SUBCONSCIOUS_API_KEY

Examples

Each file demonstrates a different way to use the Subconscious SDK:

FileTypeDescription
01_script.tsScriptSimplest example β€” run a one-shot agent query
02_http.tsHTTPExpose an AI search agent as an HTTP API endpoint
03_cron.tsCronRun a scheduled agent task on an interval
04_email.tsEmailProcess incoming emails with an AI agent

Key Concepts

Engines

EngineDescription
tim-edgeFast & efficient, tuned for search tools
tim-gptRecommended for most use cases (GPT-4.1 backed)
tim-gpt-heavyMaximum capability for complex tasks (GPT-5.2 backed)

Tools

Tools extend what the agent can do. Three types:

  • Platform tools β€” hosted by Subconscious (e.g. fast_search, deep_search)
  • Function tools β€” your own HTTP endpoints the agent can call
  • MCP tools β€” connect to any MCP server

Structured Output

Use answerFormat with a Zod schema + zodToJsonSchema() to get typed JSON responses.

Links

  • Subconscious Docs
  • npm package
  • Val Town Docs
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
AboutAlternativesPricingBlogNewsletterCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
Β© 2026 Val Town, Inc.