Skip to main content
POST https://xquik.com/api/v1/compose
Free. This endpoint does not consume credits.
Use this guided Tweet composer to plan, refine, and validate one post draft. Its source is xai-org/x-algorithm. It never returns finished Tweet text. It never publishes a post. It never predicts likes, replies, reposts, bookmarks, profile visits, or follower growth. Use 3 Compose calls for one complete writing cycle.

Workflow

  1. Call compose with a topic.
  2. Answer its 4 questions.
  3. Call refine with the topic, goal, and tone.
  4. Write the draft. Call score with its full text.
The guidance maps public source facts to the requested goal. Ranking stays viewer-specific. Published defaults may differ from production experiments.

Choose the correct tweet writing step

Each call returns only its step-specific shape. Do not deserialize every result into one generic response type.

Match the goal to your tweet intent

The goal selects one question and matching source guidance.compose defaults to engagement when you omit goal. Send a documented goal when later steps depend on it.

Requests

Returns 10 source facts and 4 follow-up questions.
step and topic are required.These fields are optional.
  • goal takes engagement, followers, authority, or conversation. Defaults to engagement.
  • styleUsername names an analyzed X (Twitter) username or saved custom style label.

Refine request context

The tone field accepts any non-empty string. The response keeps the requested tone, topic, goal, media, action, and additional context. It then adds source-backed viewer-action guidance. It does not invent style rules.

Headers

Send x-api-key with an Xquik API key. OAuth clients can send a bearer token through the Authorization header instead.

Body

The API ignores unknown body fields. Send only the fields for the selected step.

Response

200 OK

The response shape matches the requested workflow step.

Compose response

Match a saved Twitter writing style

styleUsername searches only styles owned by the authenticated account. Xquik lowercases the lookup value before searching.The 200 fallback still returns the complete Compose response. The 400 branch returns only the documented error object. Analyze the username first when the account can run a new style analysis.

Refine response

Score response

This step runs one deterministic input check. It checks that the draft contains text. It does not score quality or predict ranking.
intentUrl appears only when the draft contains text.

Errors

Missing step-specific fields also return invalid_input.

Tweet composer questions

What does the tweet composer generate?

It returns source facts, 4 questions, request context, and one input check. You write the draft between refine and score.

Is this endpoint a tweet generator?

No. A Tweet generator usually writes final post text from one prompt. This endpoint guides a 3-step writing workflow. It helps plan, refine, and check one draft without publishing it.

How does it help write a good tweet?

Choose a goal before drafting. Answer the 4 questions. Add verified context when needed. Treat source signals as viewer-specific, not universal advice.

Can it supply current Twitter post ideas?

No. radarRecommendations remains an empty compatibility field. Supply verified facts through additionalContext during Refine.

Can it match a saved Twitter writing style?

Yes. Send an analyzed username or custom style label in styleUsername. A successful match returns cached styleTweets. Use those samples to study sentence length, vocabulary, openings, and calls to action. The endpoint does not rewrite the draft. It also doesn’t verify that one style belongs to a public X (Twitter) username.

What happens when a draft check fails?

passed becomes false for a blank draft. The checklist suggests adding text. intentUrl stays absent until the draft contains text.

Does the score predict likes, replies, or reposts?

No. It never predicts likes, replies, reposts, bookmarks, profile visits, or follower growth. Ranking stays viewer-specific.

Can the endpoint publish the draft?

No. Use Create Tweet after review. You can also open intentUrl after the input check passes.
Research current context with Radar. Save accepted text with Create Draft. Analyze a reference voice with Analyze Style.

Response examples

200 example

  • 400 { "error": "invalid_input", "message": "Invalid input. Check the request body." }
  • 401 { "error": "unauthenticated", "message": "Authentication required. Provide a valid API key or bearer token." }
  • 403 { "error": "api_key_paused", "message": "This API key is paused. Resume it at dashboard.xquik.com/api-keys to use it again." }
  • 429 { "error": "rate_limit_exceeded", "message": "Too many requests. Try again later.", "retryAfter": 60 }