continuedev/continue · error · Error
Bedrock does not support completions API
Error message
Bedrock does not support completions API
What it means
Bedrock's runtime API only exposes conversational/invoke-model endpoints, not the legacy OpenAI-style /v1/completions text-completion API. The adapter therefore implements the CompletionCreateParamsNonStreaming surface by unconditionally throwing when completionNonStream is called — it is a hard capability gap, not a runtime failure.
Source
Thrown at packages/openai-adapters/src/apis/Bedrock.ts:577
} catch (error) {
if (error instanceof Error) {
if ("code" in error) {
throw new Error(
`AWS Bedrock stream error (${(error as any).code}): ${error.message}`,
);
}
throw new Error(`Error processing Bedrock stream: ${error.message}`);
}
throw new Error(
"Error processing Bedrock stream: Unknown error occurred",
);
}
}
completionNonStream(
body: CompletionCreateParamsNonStreaming,
): Promise<Completion> {
throw new Error("Bedrock does not support completions API");
}
completionStream(
body: CompletionCreateParamsStreaming,
): AsyncGenerator<Completion> {
throw new Error("Bedrock does not support completions API");
}
fimStream(
body: FimCreateParamsStreaming,
): AsyncGenerator<ChatCompletionChunk> {
throw new Error("Bedrock does not support FIM directly");
}
private async getInvokeModelResponseBody(model: string, jsonBody: object) {
const payload = {
body: JSON.stringify(jsonBody),
modelId: model,View on GitHub (pinned to 5522c6f44c)
Solutions
- Switch the call to chatCompletionNonStream with a messages array ([{role: 'user', content: prompt}]).
- If you must keep the completions interface, route Bedrock traffic to a different backend or wrap it in a translation layer that converts prompt→messages.
- Add a capability check in your router so Bedrock requests never reach completionNonStream.
Example fix
// before
const result = await api.completionNonStream({ model: 'bedrock/anthropic.claude-3-sonnet', prompt: 'Hello' });
// after
const result = await api.chatCompletionNonStream({ model: 'bedrock/anthropic.claude-3-sonnet', messages: [{ role: 'user', content: 'Hello' }] }); Defensive patterns
Strategy: validation
Validate before calling
const supportsCompletions = (api: any) => typeof (api as any).completionNonStream === 'function' && api.constructor.name !== 'Bedrock';
if (!supportsCompletions(api)) throw new Error('Use chatCompletionNonStream for this provider'); Prevention
- Maintain a per-provider capability map (completions, fim, embeddings).
- Default to chat/messages APIs in provider-agnostic code.
- Grep your codebase for completionNonStream/completionStream calls before adding Bedrock.
When it happens
Trigger: Calling completionNonStream({model: 'bedrock/...', prompt: '...'}) on the Bedrock adapter; generic router code that dispatches every provider through the completions API; porting code from an OpenAI adapter to Bedrock without changing the endpoint.
Common situations: Multi-provider abstraction layers that assume all adapters support legacy completions; older codebases migrating from Codex-style prompt completion to chat; tools defaulting to the completions endpoint when no messages array is present.
Related errors
- AI SDK provider does not support legacy completions API. Use
- Bedrock does not support FIM directly
- GitLab Private Token is required!
- AWS Bedrock rerank error (${(error as any).code}): ${error.m
- Error in BedrockReranker.rerank: ${error.message}
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/c75e5b9c1061e850.
Report an issue: GitHub.