Fliplet.AI

Fliplet.AI

Generate text and images, transcribe audio and create embeddings through Fliplet. Fliplet.AI is preloaded in apps and uses Fliplet access and AI credits without a customer-supplied OpenAI or Gemini key.

Fliplet.AI runs models through Fliplet’s server API and requires an internet connection. It does not provide an on-device model or offline inference.

Table of contents

AI methods

Feature Method Model category
Generated text, summaries or an AI chatbot createCompletion(); ask() for a single text request OpenAI text or Gemini text
Model-requested app operations createCompletion() and the tool-calling guide Compatible function-tool model
Research with cited web sources createCompletion() and the grounded-answers guide Compatible hosted-search model
PDF/photo analysis and structured extraction createCompletion() and the media-input guide Compatible file/image and structured-output model
OpenAI image generation generateImage() Images
Gemini image generation createCompletion() with Gemini contents Images
Audio transcription transcribeAudio() Transcription
Text vectors for semantic search createEmbedding() Embeddings

For messages between people, use Fliplet.Chat. The AI reply presentation and conversation guide covers safe formatting, progressive output and app-managed conversation history.

AI models

Specify a compatible model ID from AI models available through Fliplet. Honor a supported user-selected model; otherwise choose for the task’s capabilities and cost constraints. Catalog order and example IDs are not a suitability ranking. Omitting model uses a fallback, including incompatible fallbacks for some text formats.

An alias pins the requested ID, while the provider can change the version behind it. A compatible dated snapshot can pin a version but remains subject to retirement. Fliplet remaps the legacy image IDs.

App JavaScript uses the current app and its Fliplet authentication context. An external integration needs its own Fliplet token and the correct regional API URL and app ID; see the app AI REST reference. Native availability does not grant access to private app data: fetch only authorized records and include only the context needed for the request.

First request

This single-turn example uses Chat Completions with an explicitly selected illustrative model. Replace the model only with one compatible with the same format, or adapt the request and response handling together.

async function summarizeNote(note) {
  try {
    const result = await Fliplet.AI.createCompletion({
      model: 'gpt-6.1-sol',
      messages: [{ role: 'user', content: 'Summarize this note in one sentence: ' + note }]
    });
    const answer = result && result.choices && result.choices[0] &&
      result.choices[0].message && result.choices[0].message.content;

    if (typeof answer !== 'string' || !answer.trim()) {
      throw new Error('No text reply was returned.');
    }

    return answer;
  } catch (error) {
    console.error('Could not summarize the note:', error);
    throw error; // The caller can retain the draft and show a retry control.
  }
}

summarizeNote('The workshop starts at 9 AM. Bring a laptop.').then(console.log).catch(function() {});

API reference

Initialization

Fliplet.AI(options?: Object): AIInstance

Creates an instance for OpenAI Chat Completions. The wrapper supplies only the completion model fallback; it does not insert temperature, n or stop defaults. Their supported values and defaults depend on the model and Chat Completions schema.

Option Type Behavior
model String, optional Select explicitly. Omission uses the JavaScript completion fallback.
temperature Number, optional Sampling setting where the chosen model supports it.
n Number, optional Number of choices where supported by the chosen model.
stop String or Array of Strings, optional Stop sequences where supported by the chosen model.
stream Boolean, optional true enables Fliplet socket streaming. Omission uses a non-streaming request.
const conversation = Fliplet.AI({ model: 'gpt-6.1-sol' });

Instance methods

conversation.ask(message: String, role?: String, modelOverride?: String)

Appends the submitted message to conversation.messages and sends that array as Chat Completions messages. role defaults to 'user'; modelOverride applies to that call. Non-string message throws synchronously. A failed request still leaves the submitted message in the instance’s array.

The instance does not append model replies. For a chatbot with follow-up questions, manage relevant user and assistant messages through createCompletion(); see conversation history.

async function askOnce() {
  try {
    const conversation = Fliplet.AI({ model: 'gpt-6.1-sol' });
    const result = await conversation.ask('Suggest a title for a workshop on teamwork.');
    const text = result && result.choices && result.choices[0] &&
      result.choices[0].message && result.choices[0].message.content;
    if (typeof text !== 'string' || !text.trim()) throw new Error('No text reply was returned.');
    console.log(text);
  } catch (error) {
    console.error('The title request failed:', error);
  }
}
askOnce();

For streaming, set stream: true in the constructor and attach .stream(onChunk) to the returned request. The second ask() argument is a role string, not an options object. Use static createCompletion() for Responses or Gemini input.

Static API methods

Method Input Result
createCompletion() Model-specific text request Provider response, or a streamable Promise
generateImage() Image model and prompt Image response with base64 data
transcribeAudio() Blob/File and upload options { text: String }
createEmbedding() Text and embedding model { data: [{ embedding, index, object }], model, object, usage }

Fliplet.AI.createCompletion()

Fliplet.AI.createCompletion(payload: Object, controls?: Object): Promise

Send the payload required by the selected model in the first argument. The optional second argument contains only the client controls below; it is not sent to the provider. The return value depends on stream and returnResult:

Mode Returned request Resolved value
Buffered (stream omitted or false) Promise The provider response object for the selected format.
Streaming (stream: true), default controls Promise with .stream(onChunk), .cancel() and .guid undefined on completion; { cancelled: true } on cancellation. Incomplete output rejects.
Streaming with { returnResult: true } The same streamable Promise A terminal envelope with status and guid, preserving terminal packet fields and native response where supplied. See terminal results.
Field Type Required or behavior
model String Technically optional; explicitly select a compatible text model.
messages Array of message objects Chat Completions input.
input String or Array of input items Responses input; also set useResponses: true.
useResponses Boolean true chooses OpenAI Responses. Omit for Gemini.
contents Array of Gemini content objects Gemini input, with an explicit Gemini model.
stream Boolean true chooses streaming; omit or use false for a buffered response.
prompt String or Array of Strings Legacy non-streaming OpenAI completion format. Its REST fallback is retired; use messages or Responses for new work.

Client controls apply only when payload.stream === true. Omit the second argument or pass {} for buffered calls; nonempty buffered controls and invalid controls reject with TypeError.

Client control Type Default and behavior
returnResult Boolean false. Set true to retain the terminal result, including the native Responses object.
timeout Number 300000 milliseconds. Must be finite and positive. The deadline covers readiness, request start and streaming; incoming chunks do not extend it.

Use one input format per request. A truthy prompt selects the legacy route on a non-streaming call, even if other input fields are also present.

Chat Completions

Use messages: [{ role, content }] and read choices[0].message.content for a plain text reply. Include relevant user and assistant replies when the task needs conversation history. Other response content, including refusal or tool calls, requires handling appropriate to the requested feature; an absent text reply is not a successful text result.

The first request is a complete Chat Completions example. See OpenAI’s Chat Completions reference for message content, supported roles and model-specific fields.

Using the Responses API

Set useResponses: true and provide input. The returned JSON contains typed output items, not a choices array. Extract text from message content with type: 'output_text'; other output items can contain reasoning, tool calls or refusals.

async function summarizeWithResponses() {
  try {
    const result = await Fliplet.AI.createCompletion({
      model: 'gpt-6.1-sol',
      useResponses: true,
      input: 'Summarize the purpose of a project kickoff meeting in one sentence.'
    });
    const text = (result && result.output || []).filter(function(item) {
      return item.type === 'message';
    }).flatMap(function(item) {
      return item.content || [];
    }).filter(function(part) {
      return part.type === 'output_text' && typeof part.text === 'string';
    }).map(function(part) {
      return part.text;
    }).join('\n');

    if (!text.trim()) throw new Error('No text reply was returned.');
    console.log(text);
  } catch (error) {
    console.error('The Responses request failed:', error);
  }
}
summarizeWithResponses();

For app-managed conversation context, input can also be an array such as [{ role: 'user', content: 'Hello' }, { role: 'assistant', content: 'Hello! How can I help?' }, { role: 'user', content: 'Suggest a meeting agenda.' }]. Preserve model-required tool items when using tools. Use the tool-calling, grounded-answer and media-input guides for complete workflows. Declaring tools does not execute app operations. Background execution and provider-stored conversations are not established app workflows. See the Responses schema and chatbot guide.

Using Gemini models

Use createCompletion({ model, contents }). contents uses { role, parts }; for a text request, each part is { text }. Read candidates[0].content.parts and collect its text parts.

async function summarizeWithGemini() {
  try {
    const result = await Fliplet.AI.createCompletion({
      model: 'gemini-3.5-flash',
      contents: [{ role: 'user', parts: [{ text: 'Summarize the purpose of a project kickoff meeting.' }] }]
    });
    const candidate = result && result.candidates && result.candidates[0];
    const text = (candidate && candidate.content && candidate.content.parts || [])
      .filter(function(part) { return typeof part.text === 'string' && !part.thought; })
      .map(function(part) { return part.text; }).join('\n');

    if (!text.trim()) throw new Error('No text reply was returned.');
    console.log(text);
  } catch (error) {
    console.error('The Gemini request failed:', error);
  }
}
summarizeWithGemini();

Use role: 'model' for Gemini replies in conversation history. generationConfig, systemInstruction and tools use the Gemini generateContent schema. Declaring a function does not execute it: the app must validate and authorize the requested operation, run it and send its result in Gemini’s format.

Additional request parameters

Provider fields belong to the same options object, but depend on the model and endpoint.

Format Examples of provider fields
Chat Completions temperature, max_completion_tokens, response_format, reasoning_effort, tools
Responses max_output_tokens, text.format, reasoning.effort, tools
Gemini generationConfig, systemInstruction, tools

Fliplet consumes useResponses for OpenAI routing and stream for Gemini routing. For streaming Chat Completions it adds stream_options.include_usage: true. Responses calls receive a compaction setting when the caller does not supply context_management. This does not maintain the app’s displayed conversation history. Keep the relevant history and apply provider context limits; Fliplet’s Chat Completions token warning does not enforce an app input cap or automatically trim messages.

Streaming with createCompletion()

Dependency and transport

Streaming requires the fliplet-socket dependency on the app or screen. If it is missing, createCompletion() throws synchronously. Fliplet sends the completion request over HTTP and delivers provider chunks through Fliplet sockets; the browser does not receive an SSE response from the app endpoint.

Chunk payloads

Register .stream(onChunk) immediately. The callback receives nonterminal payloads, including keepalive events. Ignore chunks without the expected content. Build the displayed reply in app state:

Request format Text in a callback payload
Chat Completions chunk.choices[0].delta.content, when present
Responses chunk.delta when chunk.type === 'response.output_text.delta'
Gemini Text parts of chunk.candidates[0].content.parts

Terminal results

With default controls, completion resolves with undefined, cancellation resolves with { cancelled: true } and incomplete output rejects with code: 'response_incomplete'. The callback receives nonterminal events only; it never receives the terminal envelope. An absent callback safely discards events.

With { returnResult: true }, the resolved envelope preserves terminal packet fields and adds:

Field Meaning
status completed, incomplete or cancelled.
guid This request’s identifier.
response The native final Responses object, when supplied by the server. Includes typed output, usage, model and other provider fields.
isIncomplete, incompleteReason Present on incomplete Responses results; inspect response.incomplete_details too. Partial output is not a successful complete result.
isCancelled, cancelled true on cancelled results.

Chat Completions and Gemini streams do not supply an assembled native response; continue assembling their content from callbacks, or use a buffered call for a native aggregate. Native refusal remains provider content and needs an explicit UI branch. Do not flatten reasoning, function calls or citations into displayed text. Preserve required typed items when continuing a tool conversation.

This example displays deltas through onText and returns the authoritative native Responses result. Load fliplet-socket first and use it after Fliplet is ready. onText must update the actual state used by your framework or renderer; see the chatbot guide.

async function streamResponseResult(prompt, onText) {
  const request = Fliplet.AI.createCompletion({
    model: 'gpt-6.1-sol', useResponses: true,
    input: prompt, stream: true
  }, { returnResult: true, timeout: 300000 });
  request.stream(function(chunk) {
    if (chunk && chunk.type === 'response.output_text.delta' && typeof chunk.delta === 'string') {
      onText(chunk.delta);
    }
  });
  const result = await request;
  if (!result || !['completed', 'incomplete', 'cancelled'].includes(result.status)) {
    throw new Error('The loaded Fliplet SDK did not return a terminal result. Do not automatically repeat the request.');
  }
  if (result.status !== 'completed') return result;
  if (!result.response || result.response.status !== 'completed' || !Array.isArray(result.response.output)) {
    throw new Error('No complete native Responses result was returned.');
  }
  return result;
}

A cached SDK asset can ignore the second argument and resolve with undefined. Guard the envelope before using advanced results and report the unsupported loaded asset without automatically regenerating or repeating actions.

Cancellation and failures

Retain the request and call request.cancel(), or Fliplet.AI.cancel(request.guid). Stop settles the local completion immediately and removes only that request’s listeners. The separate Promise returned by cancel() reports the remote DELETE acknowledgement or failure, with a 30-second deadline. Repeated cancellation of the active handle shares that operation. Cancellation before dispatch prevents the generation POST. Completing, stopping or failing one request leaves other requests and the shared socket connected.

A remote acknowledgement can report a broadcast signal; neither it nor local Stop proves that the provider stopped or that no generation or charge occurred. Keep partial output visibly interrupted. Handle the cancellation Promise’s rejection if you show remote status; local UI settlement does not wait for it.

HTTP start failures, provider failures and synchronous or asynchronous callback failures reject. Errors can be structured payloads rather than Error instances. SDK errors include stream_timeout for deadline expiry, auth_changed when the bound app/token changes and protocol_error for invalid stream packets. A token change fails closed; the request is not silently retried under another token. Best-effort abort cannot guarantee that an old-token generation stops.

The SDK does not automatically reconnect, poll for a missed terminal result or repeat a generation. A lost terminal eventually reaches the deadline. Retain drafts, mark partial output incomplete and offer an explicit recovery choice. The chatbot guide covers visible pending, error and Stop states.

Console streaming example

This plain JavaScript example uses Chat Completions and logs accumulated text as chunks arrive. It demonstrates the API lifecycle; it has no on-screen renderer. Load fliplet-socket and run after Fliplet is ready.

For an on-screen reply, use the chatbot rendering workflow. Framework callbacks must update the state used by their renderer; Vue apps should follow asynchronous reactive-state updates.

async function streamReply() {
  let text = '';
  try {
    const request = Fliplet.AI.createCompletion({
      model: 'gpt-6.1-sol',
      messages: [{ role: 'user', content: 'Write a short welcome message for workshop participants.' }],
      stream: true
    });
    request.stream(function(chunk) {
      const choice = chunk && chunk.choices && chunk.choices[0];
      const delta = choice && choice.delta && choice.delta.content;
      if (typeof delta === 'string') {
        text += delta;
        console.log(text); // Incremental console output, before the request settles.
      }
    });
    const completion = await request;
    if (completion && completion.cancelled) return;
    if (!text.trim()) throw new Error('No text reply was returned.');
    console.log('Completed reply:', text);
  } catch (error) {
    console.error('Streaming failed:', error);
  }
}
streamReply();

The console shows growing text while the request is pending, then logs the completed accumulated reply. await request supplies completion status, not that text.

Fliplet.AI.generateImage()

Fliplet.AI.generateImage(options: Object): Promise<ImageResponseObject>

Generate OpenAI images from prompt with an explicit image model. The response has created and data; GPT image data contains b64_json. It is not a hosted image URL.

Field Type Behavior
prompt String, required Image description.
model String, optional Select explicitly; see fallback/remapping.
n Number, optional Number of images, subject to model limits.
size String, optional Model-supported size; the example uses 1024x1024.
quality String, optional Model-supported quality, such as low, medium, high or auto for GPT images.
output_format String, optional png, jpeg or webp where supported.
user String, optional Provider end-user identifier; does not establish Fliplet authorization.

The wrapper does not insert image option defaults. Fliplet removes response_format and style for GPT image models. Provider defaults and constraints apply to the other fields. See the OpenAI image schema.

async function displayGeneratedImage() {
  try {
    const result = await Fliplet.AI.generateImage({
      model: 'gpt-image-2',
      prompt: 'An illustration of a workshop room with people collaborating at tables',
      n: 1,
      size: '1024x1024',
      output_format: 'png'
    });
    const imageData = result && result.data && result.data[0] && result.data[0].b64_json;
    if (typeof imageData !== 'string' || !imageData) throw new Error('No image was returned.');
    const image = document.createElement('img');
    image.alt = 'Generated workshop illustration';
    image.src = 'data:image/png;base64,' + imageData;
    document.body.appendChild(image);
  } catch (error) {
    console.error('Image generation failed:', error);
  }
}
displayGeneratedImage();

Store the image through the media API only if it needs to persist. The app owns storage authorization and the conversion from base64 data to an upload.

Gemini image generation

For configured Gemini image models, use createCompletion() with contents and Gemini generationConfig, rather than treating the OpenAI image options as interchangeable. The response contains image parts with inlineData.mimeType and base64 inlineData.data. Text parts may appear before the image.

async function displayGeminiImage() {
  try {
    const result = await Fliplet.AI.createCompletion({
      model: 'gemini-3.1-flash-image',
      contents: [{ role: 'user', parts: [{ text: 'Draw a workshop room with people collaborating.' }] }],
      generationConfig: { responseModalities: ['TEXT', 'IMAGE'] }
    });
    const candidate = result && result.candidates && result.candidates[0];
    const parts = candidate && candidate.content && candidate.content.parts || [];
    const imagePart = parts.find(function(part) { return part.inlineData && part.inlineData.data; });
    if (!imagePart) throw new Error('No image was returned.');
    const image = document.createElement('img');
    image.alt = 'Generated workshop illustration';
    image.src = 'data:' + imagePart.inlineData.mimeType + ';base64,' + imagePart.inlineData.data;
    document.body.appendChild(image);
  } catch (error) {
    console.error('Gemini image generation failed:', error);
  }
}
displayGeminiImage();

See Gemini image generation for supported models and generation options. Fliplet’s generateImage() Gemini adapter uses a different request transformation; current Gemini image compatibility through that method has not been established.

Fliplet.AI.transcribeAudio()

Fliplet.AI.transcribeAudio(audio: Blob | File, options?: Object): Promise<{ text: String }>

Uploads an existing Blob/File to the current app and returns exactly { text }. The app owns file selection, recording and transcript insertion; see record or upload audio.

Option Type Behavior
filename String, optional Nonblank multipart filename. Overrides File.name; otherwise the wrapper uses the file name or a MIME-derived name.
model String, optional Only gpt-4o-mini-transcribe, gpt-4o-transcribe or whisper-1 are accepted. See transcription models.
signal AbortSignal, optional Cancels the caller’s request.
timeout Number, optional Finite positive deadline in milliseconds. Default 120000; covers readiness, auth refresh, upload, retry and waiting for the response.

Own optional properties with undefined are omitted; null and other invalid values reject with TypeError. prompt, language, response_format, temperature and other provider options are not forwarded by this method.

Accepted base MIME types are audio/webm, audio/mp4, audio/mpeg, audio/wav and audio/ogg. Codec suffixes such as audio/webm;codecs=opus are accepted. Audio size is at most 25 MiB (25 * 1024 * 1024 bytes), inclusive. The server checks size and MIME type. Blob fallback filenames are audio.webm, audio.mp4, audio.mp3, audio.wav and audio.ogg; an unsupported or empty MIME type gets audio.webm as its filename but is still rejected by the server.

async function transcribeFile(file) {
  try {
    const result = await Fliplet.AI.transcribeAudio(file, { model: 'gpt-4o-mini-transcribe' });
    if (!result.text.trim()) throw new Error('No transcript was returned.');
    return result.text;
  } catch (error) {
    console.error('Transcription failed:', error);
    throw error;
  }
}
// Pass the File from an input[type=file] change handler; keep it for retry.

Errors and limits

Invalid audio/options/filename/signal/timeout/model values reject with TypeError before the request. Caller cancellation rejects with name: 'AbortError', code: 'ABORT_ERR'; the deadline rejects with name: 'TimeoutError', code: 'ETIMEDOUT'.

Before provider handoff, cancellation or timeout stops processing without a provider call. After handoff, it stops the caller waiting; an already-started provider request continues and successful usage may be charged. This behavior differs from completion-stream cancellation.

The server can return 400 for missing/invalid audio or an unsupported transcription model, 413 for audio over 25 MiB or 415 for an unsupported MIME type. Authentication, permission, credit and rate-limit failures can return 401, 403, 402 or 429. Keep the file and allow retry; see audio cancellation and retry.

Fliplet.AI.createEmbedding()

Fliplet.AI.createEmbedding(options: Object): Promise<EmbeddingResponseObject>

Returns text vectors for semantic search, clustering or classification. Specify a compatible embedding model.

Field Type Behavior
input String or Array of Strings, required Text to embed. Provider token limits apply per input and request.
model String, optional Select explicitly; see fallbacks.
encoding_format String, optional 'float' for numeric vectors or 'base64' for encoded vectors. Provider default is 'float'.
dimensions Number, optional Output dimensions for models supporting this field, including text-embedding-3 models.
user String, optional Provider end-user identifier; does not establish Fliplet authorization.

The response contains object, data, model and usage. Each data item contains object, index and embedding: number[] | string, according to encoding_format. usage contains prompt_tokens and total_tokens. See the OpenAI embedding schema.

async function embedNote() {
  try {
    const result = await Fliplet.AI.createEmbedding({
      model: 'text-embedding-3-small',
      input: 'The workshop starts at 9 AM. Bring a laptop.',
      encoding_format: 'float'
    });
    const vector = result && result.data && result.data[0] && result.data[0].embedding;
    if (!Array.isArray(vector) || !vector.length) throw new Error('No numeric vector was returned.');
    console.log(vector);
  } catch (error) {
    console.error('Embedding failed:', error);
  }
}
embedNote();

Use the same model and dimensions for stored records and search queries. A model change can require regenerating stored vectors; see embedding compatibility.

Rate limiting

AI requests are subject to app AI rate limits and credit availability. Additional plan limits below apply to apps using the V2 engine. V3 apps use V3 credit metering and bypass these per-plan caps; the shared app AI rate limit still applies.

V2 plan Requests per day Requests per minute
Free 100 10
Public and Private 1,000 100
Public+, Private+, Enterprise, Bronze, Silver, Gold and Platinum 10,000 100

Plan quotas are counted for the app, using its master app ID where applicable. Actual limits may be overridden by the organization’s plan configuration. An exhausted limit returns 429; insufficient AI credit capacity returns 402.

Error handling

Catch asynchronous failures with try...catch or .catch(). Completion setup can also throw synchronously, including a missing streaming dependency or invalid ask() message. Provider request failures may return 400 even when the underlying provider error has another code. Preserve the error payload for diagnosis; do not assume every failure has the same JavaScript shape.

Show a useful error and retain the user’s input. Validate the expected response shape before treating a request as successful. Retry transient connection or rate-limit failures with a delay; correct invalid payloads, unavailable models, access or credit problems before retrying. A timed-out request is not proof that no provider work or charge occurred.

Usage examples

The text examples below select a model explicitly. See the API reference for image generation, audio recording and transcription, and embeddings.

Multi-turn conversation (chat)

This buffered example illustrates request history. For an interactive UI with progressive replies and safe formatting, use the chatbot guide.

Keep { role, content } messages, including model replies, in app state. Send the relevant history on each turn. This lets follow-up questions refer to earlier answers. Persist the messages only if the app needs conversations to survive reloads, and apply the app’s normal access rules to stored content.

const history = [{ role: 'system', content: 'You are a helpful assistant.' }];

async function sendMessage(userText) {
  const next = [...history, { role: 'user', content: userText }];
  const result = await Fliplet.AI.createCompletion({
    model: 'gpt-6.1-sol',
    messages: next
  });
  const answer = result && result.choices && result.choices[0] &&
    result.choices[0].message && result.choices[0].message.content;

  if (typeof answer !== 'string' || !answer.trim()) {
    throw new Error('The assistant did not return a reply.');
  }

  history.push({ role: 'user', content: userText });
  history.push({ role: 'assistant', content: answer });
  return answer;
}

Handle loading, errors, and an empty response in the app UI. Keep the user’s draft for retry if the call fails. If the conversation grows beyond the model’s context limit, trim or summarize older messages deliberately; the API does not manage that history for the app.

Single-turn tasks

For single-turn tasks where conversation history is not needed between requests, you have two main options:

  1. New Fliplet.AI() instance per task: Each Fliplet.AI() creates a separate conversation.
    // Task 1
    const result1 = await Fliplet.AI({ model: 'gpt-6.1-sol' }).ask('Act as a JS developer. Write a function to multiply two numbers.');
    const text1 = result1 && result1.choices && result1.choices[0] && result1.choices[0].message && result1.choices[0].message.content;
    if (typeof text1 !== 'string' || !text1.trim()) throw new Error('No text reply was returned.');
    console.log('Task 1 Result:', text1);
    
    // Task 2 (different context)
    const result2 = await Fliplet.AI({ model: 'gpt-6.1-sol' }).ask('Act as a marketer. Write a welcome email.');
    const text2 = result2 && result2.choices && result2.choices[0] && result2.choices[0].message && result2.choices[0].message.content;
    if (typeof text2 !== 'string' || !text2.trim()) throw new Error('No text reply was returned.');
    console.log('Task 2 Result:', text2);
    
  2. Fliplet.AI.createCompletion(): For direct access to model-specific completion parameters with explicit message history. See static API methods.

Browser recording example

For microphone capture, final audio chunks, cleanup and transcription, use the complete recording and upload example. The method reference shows the call for an existing Blob or File.

Model catalog

AI models available through Fliplet owns the configured IDs, compatibility, provider facts and retirement notices. Select a model compatible with the method and request format.

OpenAI text models

See OpenAI text models for IDs and request-format compatibility.

GPT-4o family

The OpenAI catalog includes the GPT-4o family.

Gemini text models

See Gemini text models. These use Gemini contents and response handling.

Image models

See image models and legacy ID remapping, including the different OpenAI and Gemini method paths.

Transcription models

See accepted transcription models and their availability notices.

Embedding models

See embedding models and vector compatibility.

Fallback defaults

Omitting model uses a fallback, not a suitability recommendation. The fallback table gives the JavaScript and direct REST values; JavaScript completions insert their own fallback before calling REST.

Deprecated and retired models

See deprecated and retired models before selecting or migrating a model. A historical configuration entry does not establish provider availability.

Deprecated OpenAI text models

See OpenAI retirement notices.

Historical Gemini text models

See historical Gemini IDs.

Retired image models

See retired image IDs.

Historical IDs and additional provider models

See JavaScript metadata and additional provider IDs. Exported metadata and successful proxy routing do not establish provider availability.