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 | Source type for the topic 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 |
improve | boolean | Requires a written post. Uses exemplar-based editing process to improve content |
writeInMyVoice | boolean | If true, will write the post in the user's voice and then improve it |
newHooks | boolean | If true, will generate 10 new hooks for the post |
createCarouselsOrThread | boolean | Controls generation of carousels or thread content based on platform settings |
genre | string | Post genre Possible values: PersonalStory Personality Advice AuthorityByAssociation Giveaway CaseStudy Curation Updates Question |
postId | string | If not provided, a post or posts will be created based on the use case/source type. In that case, you will need to provide a brandId which is provided outside of the options object for the request. |
editorNodeIdentifier | string | Specifies which "node type" to generate into or use (if improving a post etc.). a editorNodeIdentifier of "Carousel" with a nodeId of "" will generate a new x post at that id/index in the post. Possible values: BrainDump Carousel CarouselHeader LinkedInMainBody Description Article |
nodeId | string | The ID of a carousel section to generate or improve |
editorNodeIdentifiersToDeleteBeforeGeneration | string[] | Node identifiers to delete before generation |
generalUseCase | string | Special use cases Possible values: GENERATE_BRAND_SETTINGS GENERATE_WRITE_PRINT GENERATE_SIMILAR_CREATORS_FOR_BRAND |
generateMoreExamples | boolean | Whether to generate additional examples |
numExamples | number | Number of examples to generate |
subject | string | The subject for content generation |
brandPropertyTagName | string | Brand property tag name for searching creator posts |
url | string | YouTube video URL or webpage to use as source material |
deepResearchSource | boolean | If true, performs deep research on the subject |
creatorPostForSubjectId | string | ID of a creator post to use as subject source |
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 |
templateId | string | ID of template to use for post format |
formatText | string | Format text for the post |
creatorPostForFormatId | string | ID of creator post to use for format |
emotionalDriver | string | Emotional driver for the content |
additionalContext | string | Additional context for generation (e.g., "make this more sarcastic") |
emojiUsage | string | Emoji usage level Possible values: none few auto many |
generatePostInBackground | boolean | Whether to save the post in the background |
shouldStream | boolean | Whether the request should stream to the client |
paradigm | string | Generation paradigm Possible values: formatAndTopic exemplars incremental |
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.