Skip to content

AIExplore

How to Use AI21 Labs for Chat and completion workflows

Learn AI21 Labs chat and completion workflows with step by step workflows, realistic examples, and verified plan notes.

AI21 Labs works well for chat and completion workflows when you run it like production work: locked brief, SOURCE facts, then fallback template focused on token budget. Confirm live plans on www.ai21.com/pricing. Start at /explore/ai21-labs.

This guide focuses on chat and completion workflows in detail. Related AI21 Labs articles: /blog/how-to-use-ai21-labs-for-enterprise-deployment-and-quotas, /blog/how-to-use-ai21-labs-for-jurassic-api-text-generation, /blog/how-to-use-ai21-labs-for-summarize-and-paraphrase-endpoints.

When this workflow is the right job

Use chat and completion workflows when the deliverable is specifically this AI21 Labs job. Switch to jurassic api text generation when that workflow already owns the asset.

Step by step workflow

1. Brief Chat and completion workflows

Write what must stay true for chat and completion workflows in AI21 Labs before settings or spend.

Brief: Chat and completion workflows
Keep: enterprise deploy from SOURCE
Avoid: invented pricing or features
Success: one reviewable output

2. Open AI21 Labs for Chat and completion workflows

Use the AI21 Labs surface that owns chat and completion workflows. Do not mix a neighboring workflow in the same pass.

Surface: Chat and completion workflows
Start: chunk text
Plans: www.ai21.com/pricing

3. Pilot Chat and completion workflows

Run a single chat and completion workflows pilot. Score clarity, grounding, and whether eval driven still matches.

Pilot: Chat and completion workflows
[ ] SOURCE facts match
[ ] batch jobs clear
[ ] Settings logged

4. Refine Chat and completion workflows

Change one chat and completion workflows dimension only. Save a template with variables for eval harness.

Refine: Chat and completion workflows
Change: API call
Keep: SOURCE and API precise

Practical chat and completion workflows examples

enterprise deploy

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "enterprise deploy".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for enterprise deploy
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving enterprise deploy.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for enterprise deploy ready for persistence, plus error handling notes.

RAG answer

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "RAG answer".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for RAG answer
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving RAG answer.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for RAG answer ready for persistence, plus error handling notes.

label taxonomy

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "label taxonomy".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for label taxonomy
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving label taxonomy.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for label taxonomy ready for persistence, plus error handling notes.

temperature low

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "temperature low".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for temperature low
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving temperature low.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for temperature low ready for persistence, plus error handling notes.

parse validate

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "parse validate".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for parse validate
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving parse validate.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for parse validate ready for persistence, plus error handling notes.

citation block

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "citation block".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for citation block
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving citation block.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for citation block ready for persistence, plus error handling notes.

chat completion

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "chat completion".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for chat completion
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving chat completion.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for chat completion ready for persistence, plus error handling notes.

batch jobs

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "batch jobs".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for batch jobs
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving batch jobs.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for batch jobs ready for persistence, plus error handling notes.

safety filter

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "safety filter".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for safety filter
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving safety filter.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for safety filter ready for persistence, plus error handling notes.

token budget

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "token budget".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for token budget
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving token budget.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for token budget ready for persistence, plus error handling notes.

retry policy

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "retry policy".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for retry policy
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving retry policy.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for retry policy ready for persistence, plus error handling notes.

eval harness

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "eval harness".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for eval harness
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving eval harness.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for eval harness ready for persistence, plus error handling notes.

prompt version

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "prompt version".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for prompt version
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving prompt version.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for prompt version ready for persistence, plus error handling notes.

Jurassic completion

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "Jurassic completion".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for Jurassic completion
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving Jurassic completion.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for Jurassic completion ready for persistence, plus error handling notes.

summarize endpoint

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "summarize endpoint".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for summarize endpoint
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving summarize endpoint.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for summarize endpoint ready for persistence, plus error handling notes.

paraphrase pass

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "paraphrase pass".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for paraphrase pass
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving paraphrase pass.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for paraphrase pass ready for persistence, plus error handling notes.

embedding index

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "embedding index".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for embedding index
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving embedding index.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for embedding index ready for persistence, plus error handling notes.

JSON schema

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "JSON schema".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for JSON schema
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving JSON schema.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for JSON schema ready for persistence, plus error handling notes.

classification

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "classification".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for classification
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving classification.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for classification ready for persistence, plus error handling notes.

long doc chunk

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "long doc chunk".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for long doc chunk
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving long doc chunk.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for long doc chunk ready for persistence, plus error handling notes.

quota check

Scenario:
An engineer is implementing AI21 Labs chat and completion workflows for the task "quota check".

Objective:
Call the API with schema/temperature discipline, validate outputs, and avoid raw model writes to production stores.

Inputs:
- Endpoint + model notes for quota check
- JSON schema or output contract
- Temperature / token budget
- Quota check before batch

Workflow:
Build request → Call chat and completion workflows → Validate schema → Persist only validated fields → Log request id

Requirements:
- Validate JSON before side effects.
- Use low temperature for routing/classify jobs involving quota check.
- Check quota before batches; confirm on official pricing pages.
- Never write raw model text into production DBs.

Expected output:
A validated chat and completion workflows response for quota check ready for persistence, plus error handling notes.

How to improve chat and completion workflows

Make chat and completion workflows easier to review by labeling citation block fields that must never change in AI21 Labs.

Speed chat and completion workflows iteration by cloning the last good AI21 Labs run and altering only log request id.

Stabilize chat and completion workflows by pinning quota aware after batch jobs is approved in AI21 Labs.

Reduce chat and completion workflows rework by rejecting drafts that invent claims about safety filter in AI21 Labs.

Improve chat and completion workflows handoffs by recording which AI21 Labs control produced the token budget result.

Strengthen chat and completion workflows by adding a second reader who only checks retry policy spelling and facts in AI21 Labs.

Lift chat and completion workflows consistency by reusing the same chunk text vocabulary across related AI21 Labs jobs.

Harden chat and completion workflows by testing an empty or incomplete prompt version input before trusting AI21 Labs defaults.

Prompting and usage guidance

Name the chat and completion workflows job, the audience, and one measurable success check before opening AI21 Labs.

Paste only verified facts under SOURCE so AI21 Labs cannot invent details during chat and completion workflows.

Specify the chat and completion workflows deliverable shape up front, such as scenes, bullets, rows, or a signed note.

Call out fixed safety filter details versus flexible meter usage choices for chat and completion workflows.

Close with a review line that asks AI21 Labs to flag unsupported claims for chat and completion workflows.

Limitations to respect

Check AI21 Labs plan gates for chat and completion workflows on www.ai21.com/pricing before you promise timelines.

Keep chat and completion workflows drafts unpublished until a human confirms SOURCE facts.

Plan and region differences can change chat and completion workflows availability. Prefer official AI21 Labs docs.

Beta or preview labels on AI21 Labs mean you should pilot chat and completion workflows before wide rollout.

Practical tips for this workflow

Budget a second chat and completion workflows pass focused on edge cases around temperature low, not only the happy path in AI21 Labs.

Use official AI21 Labs terminology for chat and completion workflows in SOPs so support recognizes chunk text requests.

Keep a chat and completion workflows checklist beside AI21 Labs so reviewers know which JSON schema details stayed locked.

Pilot chat and completion workflows on a tiny sample before spending AI21 Labs credits or executions on a full batch centered on temperature low.

When chat and completion workflows fails, change only embed then search instead of rewriting the entire AI21 Labs brief.

Document AI21 Labs UI labels used for chat and completion workflows so handoffs about JSON schema do not rely on memory.

Store winning chat and completion workflows settings as a template with variables only for temperature low fields in AI21 Labs.

Approve SOURCE facts before spending budget on chat and completion workflows variants that mention retry policy in AI21 Labs.

Pair customer facing chat and completion workflows exports with a human read that checks invented claims about JSON schema.

Log AI21 Labs run identifiers for chat and completion workflows so ops can replay fallback template failures without guessing.

Common mistakes

  • Skipping a written brief before starting chat and completion workflows in AI21 Labs
  • Inventing pricing, credits, or features not confirmed on official AI21 Labs pages
  • Scaling chat and completion workflows volume before one successful pilot
  • Mixing a different AI21 Labs workflow into the same chat and completion workflows session
  • Ignoring plan gates while scheduling chat and completion workflows deadlines
  • Publishing chat and completion workflows output without stakeholder review

For more on chat and completion workflows, see /blog/how-to-use-ai21-labs-for-enterprise-deployment-and-quotas, /blog/how-to-use-ai21-labs-for-jurassic-api-text-generation, /blog/how-to-use-ai21-labs-for-summarize-and-paraphrase-endpoints. Hub: /explore/ai21-labs.

Related articles