API Reference
Comprehensive documentation for the Typespace API
Typespace API Reference
Welcome to the Typespace API documentation. This guide will help you integrate Typespace's powerful content generation capabilities into your applications.
Quick Links
- API Usage Examples - Code examples in different programming languages
Authentication
All API requests require authentication using your Space API Key. You can obtain this key from your Typespace dashboard.
Include your API key in all requests using the X-Space-API-Key
header:
Note that brandId is optional, and is only required
Content Generation API
Endpoint
Request Body
The request body should be a JSON object with the following structure:
API Generation Options
The options
object supports numerous parameters to customize content generation. The options below are dynamically generated from the latest codebase, ensuring this documentation is always up-to-date.
Complete Options Reference
The table below lists all available options for the options
object in your API requests:
Parameter | Type | Description |
---|---|---|
topicSource | string | What type of thing should be used as the subject/idea/topic for the post? If "subject" is provided, then be sure to include options.subject in your request. Possible values: subject url inspiration example no idea |
targetPlatforms | string[] | Array of platforms to generate content for. If more than one, will run multiple generations Possible values: LinkedIn X YouTube TikTok Instagram Bluesky Threads Facebook Blog Email |
autoPlatform | boolean | If true, will create multiple posts for different platforms based on the source type. |
createCarouselsOrThread | boolean | If true, this will return numDrafts of carousels, or an X thread if this post contains X as a platform in the targetPlatforms array. If TargetPlatforms is empty, and this is true, then this will create a LinkedIn Carousel only, and no LinkedIn post. |
genre | string | The genre/type of post this is Possible values: PersonalStory Personality Advice AuthorityByAssociation Giveaway CaseStudy Curation Updates Question |
numDrafts | number | Number of drafts to generate |
subject | string | The subject/idea/topic for the post |
url | string | YouTube video URL or webpage to use as source material |
deepResearchSource | boolean | If true, performs deep research on the subject |
exampleText | string | Example text for the topic |
examplePlatform | string | Platform of the example Possible values: LinkedIn X YouTube TikTok Instagram Bluesky Threads Facebook Blog Email |
exampleGenre | string | Genre of the example Possible values: PersonalStory Personality Advice AuthorityByAssociation Giveaway CaseStudy Curation Updates Question |
formatText | string | Template format for the post (use [TOPIC] as placeholder) |
returnRawPost | boolean | Return the post as simple raw text - true by default when using API. If true, this will also always create a new post and return the stream/string in the response. |
emotionalDriver | string | The emotional driver or pain point for the audience |
additionalContext | string | Additional context or instructions for generation |
emojiUsage | string | Emoji usage level Possible values: none few auto many |
shouldStream | boolean | Whether the request should return a stream or if false - just text |
mediaOptions.generateQuoteImage | boolean | Whether to generate a quote image |
mediaOptions.quoteImagePrompt | string | Prompt for generating a quote image |
Option Categories
The generation options are organized into several logical categories:
Core Generation Settings
targetPlatform
/targetPlatforms
- Specify which platform(s) to generate content forgenre
- The type of post to generateparadigm
- The generation approach to useshouldStream
- Whether to stream the response back to the client
Content Source Options
topicSource
- Where to source the topic fromsubject
- The main subject for content generationurl
- A URL to use as source materialdeepResearchSource
- Whether to perform deep research on the sourceexampleText
- Example text to use as a reference
Content Customization
improve
- Improve existing contentwriteInMyVoice
- Write in the user's voicenewHooks
- Generate new hooks for a postcreateCarouselsOrThread
- Generate carousels or thread contentemojiUsage
- Control emoji density in generated contentemotionalDriver
- Set the emotional toneadditionalContext
- Provide additional context or instructions
Advanced Options
mediaOptions
- Options for media generation
Post Genres
Available post genres:
PersonalStory
Personality
Advice
AuthorityByAssociation
Giveaway
CaseStudy
Curation
Updates
Question
Response
For non-streaming responses, the API returns a JSON object with the following structure:
For streaming responses (shouldStream: true
), the API returns a text stream with content chunks.
Error Responses
The API may return the following error responses:
404 Not Found
: You do not have access to the specified brand or it does not exist500 Internal Server Error
: An unexpected error occurred
Examples
Below are some basic examples. For more detailed examples and code snippets in different programming languages, see the API Usage Examples page.
Generate a LinkedIn Post
Improve an Existing Post
Generate Content Based on a URL
Using Multiple Options
Rate Limits
The API is subject to rate limiting. Currently, users are limited to 10 requests per 10 seconds.
Need Help?
If you encounter any issues or have questions about the API, please contact our support team or visit our documentation for more information.